View Full Version : Query show empty value ?


timpepu
11-24-2009, 03:47 AM
Hi !

I have this kind of formula !

IIf([Hoitotili2]<>"51";IIf([Hoitotili2]<>"52";IIf([Hoitotili2]<>"61";IIf
([Hoitotili2]<>"62";"EUR";[Ulk os maa]))))

I get only value EUR ,if value is examble 51 I the result is empty, not the value from field "Ulk os maa"

Bs
Timo

namliam
11-24-2009, 03:50 AM
Null does not equal anything and does not -not equal- anything.

Any compare with a null will aways return a bad value unless you physicaly exclude it by using
NZ ()
Is null
Null

spaddhu
11-24-2009, 04:05 AM
Forget nulls.. I don't see the else part of the outer IIF statements at all.
In this case first we first check if Hoitiotili <> 51, then <> 52, then <> 61, finally <> 62. If all satisfies then "EUR", else if Hoitiotili=62 then "Ulk os maa".
You have not written in the else handlers of the outer IIFs.
Please recheck the expression.