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

Need Help with IIF Statement Inside Access Query 2

Status
Not open for further replies.

robertthomas

Technical User
Aug 11, 2005
1
US
Ok, here's my problem. I want to look at 2 columns, COL1 and COL2. If either of them have number 3 or greater, then I would like my new COL3 to display "Level 2". If COL1 and COL2 are less than 3 but greater than 0, then COL3 should say, "Level 1". If COL1 and COL2 say 0, then it should display "Level 0." If anything else, than blank.

Below is my attempt at this:

COL3:IIf([COL1] Or [COL2]>=3,"Level 1",IIf(([COL1] And [COL2]<3) And ([COL1] Or [COL2]>0),"Level 2",IIf([COL1] Or [COL2]=0,"Level 0","")))

Any help would be greatly appreciated.

Robert Thomas
 
IIf(COL1>=3 OR COL2>=3, 'Level 2', IIf(COL1>0 AND COL2>0, 'Level 1',IIf(COL1=0 AND COL2=0,'Level 0','')))

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top