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)
 
G

Guest

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Query Criteria IIf statement 4
Too many IIF statements 3
IIf statement 1
IIF statements 2
Aggregate Function Error 0
Limits of IIF? 1
Calculating Time Difference 2
iif statement 5

Top