IIF statement problem

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

Guest

I want to return text if two of five possible values are in a field. Here is an example of what I have been trying to use:

From Fund Type: IIf([From Fund] Like "*4*" Or Like "*5*","Facilities","Resources")

This expression returns only the not true value of "Resources". I have tried "and" as an operator with the same erroneous value. I I use only one like value, the true value of "Facilities returns. I tried joining two expressions with ; iif.... and got 0 for the true value and -1 for the not true value...any other joins of the expression I have tried have resulted in some type of error message.

Any suggestions? ***thanks***
 
Hi,

iif( (FieldName Like "*4*" ) AND ( FieldName Like "*5*" ), " both 4
and 5 ", "either one of 4, or 5 is (are) absent")

would return "both 4 and 5" if FieldName value is "x5y4z", as example.




Hoping it may help,
Vanderghast, Access MVP


susm said:
I want to return text if two of five possible values are in a field. Here
is an example of what I have been trying to use:
From Fund Type: IIf([From Fund] Like "*4*" Or Like "*5*","Facilities","Resources")

This expression returns only the not true value of "Resources". I have
tried "and" as an operator with the same erroneous value. I I use only one
like value, the true value of "Facilities returns. I tried joining two
expressions with ; iif.... and got 0 for the true value and -1 for the not
true value...any other joins of the expression I have tried have resulted in
some type of error message.
 
this worked! thank you..

----- Jim Richards wrote: ----

Try this: From Fund Type: IIf([From Fund] Like "*4*" Or [From Fund] Like "*5*","Facilities","Resources"

Jim
 
Back
Top