error creating an If simple statement

E

erick-flores

I am getting the following error, and I dont know why

"The expression you entered has a function containing the wrong number
of arguments."

Past 0-30 days: IIf([proj_ship_date]-[request_date]>=0 and
IIf([proj_ship_date]-[request_date]<30,[Days Diffe],0))



Any ideas??? I am sure I am missing something...


Thanks in advance!
 
G

Guest

Try this ---
Past 0-30 days: IIf([proj_ship_date]-[request_date]>=0 And
[proj_ship_date]-[request_date]<30,[Days Diffe],0))

Not two IIF's as you only have a single TRUE ( [Days Diffe] ) and a single
FALSE ( 0 ).
 
G

Guest

The IIf should be
IIf(Criteria, then , else)

If you have nested IIf it should be

IIf(criteria,then,IIf(criteria, then,else))

each IIf should have then and else

Your IIf doesn't need nested IIf, try


Past 0-30 days: IIf([proj_ship_date]-[request_date]>=0 and
[proj_ship_date]-[request_date]<30,[Days Diffe],0)
 

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

Top