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

IIF HELP

Status
Not open for further replies.

Gootz11

Technical User
Jul 7, 2003
14
US
Hello,
I have the following IIF statement but i keep getting an #error. any ideas what i am doing wrong?
Thanks
JG

REC: IIf([adj]>=[trigger],&quot;YES&quot;,IIf([adj]<[trigger],&quot;NO&quot;))

I even tried this and still keep getting an error.

REC2: IIf([adj]>=[trigger],&quot;YES&quot;,&quot;NO&quot;)

Thanks in advance

JG
 
Oh. Sorry. That usually means Access is not recognizing one of the fields. Make sure you have spelled everything correctly.
 
The correct IIf function is the one for REC2. You can get the #Error if one of the values is Null. Try this:

IIf(nz([Adj],0)>nz([trigger],0),&quot;Yes&quot;,&quot;No&quot;)

The nz() converts Nulls to whatever you indicate with the second parameter. You may want to use something other than zero for your query.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top