IIf expression with multiple criteria (1 Viewer)

xyba

Registered User.
Local time
Today, 17:58
Joined
Jan 28, 2016
Messages
189
I'm attempting to create a query field with an IIf expression to lookup three checkbox fields for their value and if the value is "No" in all three fields I want to return a question mark "?" but it's resulting in a syntax error.

It appears to be an issue with the whole expression because I've tried changing the "?" for a string but it still results in a syntax error.

The expression I'm trying is:
=IIf([FieldA]=”Yes”,”A”,IIf([FieldB]=”Yes”,”B”,IIf([FieldC]=”Yes”,”C”,”?”)))
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 00:58
Joined
May 7, 2009
Messages
19,242
maybe got to do with your double quote mark on your expression, try:

if your fields are all string (text).

=IIf([FieldA]="Yes","A",IIf([FieldB]="Yes","B",IIf([FieldC]="Yes","C","?")))

if it is boolean.

=IIf([FieldA]=True,"A",IIf([FieldB]=True,"B",IIf([FieldC]=True,"C","?")))
 

xyba

Registered User.
Local time
Today, 17:58
Joined
Jan 28, 2016
Messages
189
Changing from "Yes" to True worked. Thank you, as ever.
 

Users who are viewing this thread

Top Bottom