error creating an If simple statement

  • Thread starter Thread starter erick-flores
  • Start date Start date
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!
 
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 ).
 
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)
 
Back
Top