Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IIF Syntax Problem 1

Status
Not open for further replies.

Mike555

Technical User
Feb 21, 2003
1,200
US
I'm attempting to use this as a query expression:
RemarkType: IIf([Certificate] Like "1 Obt*" Or "2 Obt*","AType","BType")

But the Like part is not working, and all records are showing as "AType".

How can I fix this? Thanks.

--
Mike

Why make it simple and efficient when it can be complex and wonderful?
 
You cannot give multiple conditions to a Like using Or - you have to use two Like statements with Or.

If([Certificate] Like "1 Obt*" Or [Certificate] Like "2 Obt*","AType","BType")

Or using the square brackets to match any of the characters between:

IIf([Certificate] Like "[12] Obt*","AType","BType")


 
Thank you very much!

--
Mike

Why make it simple and efficient when it can be complex and wonderful?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top