Is it possible to use an iif statement in a query iff= [STAT_CODE] =30 then say putaway and iff [STAT_CODE]= 50 then say allocated and iff [STAT_CODE]= 40 then say not allocated.
Is it possible to use an iif statement in a query iff= [STAT_CODE] =30 then say putaway and iff [STAT_CODE]= 50 then say allocated and iff [STAT_CODE]= 40 then say not allocated.
That is nesting IIF's and perfectly legal up to 7 levels. Have you tried it yet?
I havent, How would you write that?
What do you want returned if the [STAT_CODE] is not equal to 30, 40 or 50? Is the [STAT_CODE] field Numeric or Text?
Null, and its a number in the table
So you have a Numeric field that contains a Null until you put something in it?
Will the [STAT_CODE] field ever have a value other than 30, 40, 50 or Null?
Last edited by June7; 07-01-2013 at 05:12 PM.
Try:
IIf([STAT_CODE]=50, "allocated", IIf [STAT_CODE]=40, "not allocated", "unknown"))
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.