IIF function question

G

Guest

I have this function in my query: URG_IN:
IIf([MCAUTH_URG_IN]"",N,[MCAUTH_URG_IN]). The MCAUTH_URG_IN field can be
many letters of the alphabet, but if it is blank I want it to be an "N". Can
someone tell me what is wrong with this query?

Thanks.
 
G

Guest

You omitted the equal sign and quotes around the 'N'.
URG_IN: IIf([MCAUTH_URG_IN]="","N",[MCAUTH_URG_IN]).
 
G

Guest

Thanks. It worked.

KARL DEWEY said:
You omitted the equal sign and quotes around the 'N'.
URG_IN: IIf([MCAUTH_URG_IN]="","N",[MCAUTH_URG_IN]).
--
KARL DEWEY
Build a little - Test a little


LisaK said:
I have this function in my query: URG_IN:
IIf([MCAUTH_URG_IN]"",N,[MCAUTH_URG_IN]). The MCAUTH_URG_IN field can be
many letters of the alphabet, but if it is blank I want it to be an "N". Can
someone tell me what is wrong with this query?

Thanks.
 
J

John W. Vinson

I have this function in my query: URG_IN:
IIf([MCAUTH_URG_IN]"",N,[MCAUTH_URG_IN]). The MCAUTH_URG_IN field can be
many letters of the alphabet, but if it is blank I want it to be an "N". Can
someone tell me what is wrong with this query?

Thanks.

The syntax [MCAUTH_URG_IN]"" is meaningless - there is no operator between the
fieldname and the empty string, and an empty string is not the same as NULL in
any case.

Try not using IIF at all - instead try

NZ([MCAUTH_URG_IN], "N")

The NullToZero function NZ will return a letter N if the value in the field is
NULL.

John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top