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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking Values in Several Query Fields 1

Status
Not open for further replies.

osjmgr

Technical User
Apr 22, 2005
6
US
Hello:

I am writing an expression in a query to check whether any of 5 Yes/No fields returns the value of Yes. I wrote the following nested IIF function, however, it returns an error:

BPIssue: IIF([Field1]="Yes", "Yes", IIF([Field2]="Yes","Yes",IIF([Field3]="Yes","Yes",IIF([Field4]="Yes","Yes",IIF([Field5]="Yes","Yes","No")))))

What I am trying to accomplish is the same as the IF(OR( function in Excel. Any ideas?
 
it returns an error
Which error ?
If your Yes/No fields are true boolean fields you may try this:
BPIssue: IIf(([Field1]+[Field2]+[Field3]+[Field4]+[Field5])<>0,"Yes","No")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top