View Single Post
  #3  
Old May 17th, 2010, 06:11 PM posted to microsoft.public.access.queries
Marshall Barton
external usenet poster
 
Posts: 5,361
Default Multiple criteria IIF function help

Cam wrote:
I am trying to create an IIF query field where if RtgGrp not equal NA or
Non, the return Yes, otherwise return No. But it is not working. What is
wrong with the formula? Thanks

NoNONV?: IIf([RtgGrp]"NA" or "Non","Yes","No")



Two things, you must use both operands in each comparison
and since the RtgGrp field can not be equal to both NA and
NON, the Or will always be true. Do it this way:

NoNONV?: IIf(RtgGrp"NA" AND RtgGrp"Non","Yes","No")

It is a poor practice to use a name with a non alphanumeric
character, so I strongly suggest that you get rid of the ?
in the calculated field's name.

--
Marsh
MVP [MS Access]