Access2000 IIF -STATEMENT

J

jack-geronimo

Why this will not function in Access2000


IiF (
[bei_aktiv_datum] <=Now() and [bei_archiv_datum] >=Now(),1,
IiF(
[bei_aktiv_datum]="", 1, 0
)
)
As SortOrder

if i do the second compare with a access function like Date() or now
everything is allright but the snippet above alway writes only a
'#Fehler' (in english #Error) in this Field.

I appreciate your help, thank you
 
V

Van T. Dinh

Are you aware of Null?

If [bei_aktiv_datum] is Null, the criteria for the outer
IIf will give you error, AFAIK.

It looks to me that you compare a Date value to a String
in the criterion for the inner IIf which I wouldn't trust.

HTH
Van T. Dinh
MVP (Access)
 
J

jack-geronimo

Thanks that was the problem.
I compared a Date value to a String and wasn't aware of Null
 
Top