IIF question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm looking for the proper syntax for using the IIF statement...this is what
I want to do:

IIF([myField] LIKE "Approved*",then do something,else something else)

I'm having trouble with proper syntax for LIKE and *. Or using = instead of
LIKE.
 
quixote said:
I'm looking for the proper syntax for using the IIF statement...this is what
I want to do:

IIF([myField] LIKE "Approved*",then do something,else something else)

I'm having trouble with proper syntax for LIKE and *. Or using = instead of
LIKE.

Your syntax is fine, but you have to realize that IIF() will return one *value*
when the test argument is True and return a different *value* when the test
argument is False. You can't make it DO anything. If you are using this in
code and want to DO stuff then use an If-Then block instead.
 
If myField is type Text you could use LIKE statement, but only to find
"Approved*" but if the field is not exactly equal then always will take the
ELSE way.
Hope this help

Luis Gomez
 
Back
Top