IIF in a query

Mobiusrune

Registered User.
Local time
Today, 07:33
Joined
Jan 7, 2013
Messages
28
Hi,

I am making a report off of a query. The report is returning values from a Option Group. 1=Yes, 2=No and 3=N/A.

The report returns the numeric values and I want the value labels instead. So, I created a column in the query for exp1 which looks like the following:

=IIF([VSArrive]=1,"Yes",IIF([VSArrive]=2,"No","N/A"))

What the report returns is #Error. HELP!
 
Formula looks okay; you wouldn't want the equals sign in a query.
 
=IIF([VSArrive]=1,"Yes",IIF([VSArrive]=2,"No","N/A"))
In addition to pbaldy's suggestion

Check out :

IIF([VSArrive]="1","Yes",IIF([VSArrive]="2","No","N/A"))

Thanks
 
If the values are really from an option group, they would be numeric.
 
It could be because of the field name in the query and the control name in the report is the same - try renaming the control name in the report.
 
In addition to pbaldy's suggestion

Check out :

IIF([VSArrive]="1","Yes",IIF([VSArrive]="2","No","N/A"))

Thanks

Thanks recyan. I was missing the quotation marks around the option value. It's working now wonderfully.
 
Glad you got things working.
Seems, you have VSArrive field in your table as Text Datatype. Correct me, if I am wrong.

Thanks
 

Users who are viewing this thread

Back
Top Bottom