Query IIF statement Help

Sweetnuff38

Registered User.
Local time
Yesterday, 21:07
Joined
Dec 7, 2007
Messages
74
I have the following code in my query and it seems to be working fine, but I would also like it to show the Not Overdue Items.


Overdue: IIf([Investigation Status]="Open",IIf([DueDate]<=Date(),"OVERDUE"))

Any help would be much appreciated!

Tracy
 
Something like this?

Overdue: IIf([Investigation Status]="Open",IIf([DueDate]<=Date(),"OVERDUE", "Not Overdue"))
 
Tried that, seemed to make sense to me too, but the field that should be not overdue is howing blank?
 
Tried that, seemed to make sense to me too, but the field that should be not overdue is howing blank?

Okay, got the NO part in the wrong place then:

Overdue: IIf([Investigation Status]="Open",IIf([DueDate]<=Date(),"OVERDUE"), "Not Overdue")
 
As usual, brilliant! Such a simple thing!

Thank very much
Tracy
 
When writing IF statments I try doing the following to keep things orginised:

IIf(A=B,c,d)
A=[Amount]
B=20
c="Twenty"

d = iif(B>E,f,g)
E=20
f="More than twenty"
g="Less than twenty"

Then you start putting it together
IIf(A=B,c,(iif(A>E,f,g)))

IIf([Amount]=20,"Twenty",(iif([Amount]>20,"More than twenty","Less than twenty"
)))
 

Users who are viewing this thread

Back
Top Bottom