IsNull and IIf together

G

Guest

I can't figure out what is wrong with this statement.

=IIf(IsNull([Date Completed]),"Pending", IIf([Date Completed]>[Due
Date]),"Past Due","On Time")

My error says i have the wrong number of expressions - but I don't see it.

Thanks for the help!!!
 
D

Douglas J Steele

It's your parentheses. You've got it in the wrong place in the 2nd IIf
statement:

=IIf(IsNull([Date Completed]),"Pending", IIf([Date Completed]>[Due
Date],"Past Due","On Time"))
 
D

Dirk Goldgar

MMH said:
I can't figure out what is wrong with this statement.

=IIf(IsNull([Date Completed]),"Pending", IIf([Date Completed]>[Due
Date]),"Past Due","On Time")

My error says i have the wrong number of expressions - but I don't
see it.

Thanks for the help!!!

I think you have a misplaced closing parenthesis on the nested IIf
function. Try this:

=IIf(IsNull([Date Completed]),"Pending", IIf([Date Completed]>[Due
Date],"Past Due","On Time"))

Note that the above will have been wrapped by the newsreader, but was
entered on one line.
 
G

Guest

THANKS!!!!! It has been driving me NUTS!!!!

Dirk Goldgar said:
MMH said:
I can't figure out what is wrong with this statement.

=IIf(IsNull([Date Completed]),"Pending", IIf([Date Completed]>[Due
Date]),"Past Due","On Time")

My error says i have the wrong number of expressions - but I don't
see it.

Thanks for the help!!!

I think you have a misplaced closing parenthesis on the nested IIf
function. Try this:

=IIf(IsNull([Date Completed]),"Pending", IIf([Date Completed]>[Due
Date],"Past Due","On Time"))

Note that the above will have been wrapped by the newsreader, but was
entered on one line.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 

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


Top