Full Version: Iff
UtterAccess Discussion Forums > Microsoft® Access > Access Queries
brob2437
Are you able to nest IIf statements just like in Excel?
That I am trying to do is build a column in a query that looks at more than one column then kicks out a TRUE or FALSE. For instance, Column 1 = Jan, Column 2 = Feb, Column 3 = March. I need to build a formula that looks at the 3 columns and if the all three are showing a 0, then "YES", otherwise "NO".
niesz
Yes. You can nest IIf's 7 layers deep. Check the Access Help files for syntax.

...and Welcome to UA!

I just re-read your post. This can be accomplished with only 1 IIf.
Edited by: niesz on Wed Nov 16 9:21:09 EST 2005.
brob2437
Thanks!!!!!!
I am a certified excel expert and just started playing with access a week ago so bare with me...
Otried help but couldnt find this syntax.
niesz
So, do you need further assistance??
fkegley
Iif([Jan] = 0 AND [Feb] = 0 AND [March] = 0, "Yes", "No")
If any could be NULL then you will want the Nz to convert NULL to 0.
Iif(Nz([Jan],0) = 0 AND Nz([Feb],0) = 0 AND Nz([March],0) = 0, "Yes", "No")
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.