IF-Then Statement

C

CCross

I need help with the following statement.
=IIf([#Days]>=2),(([MealsA]*0.75)*[#People]*[#Trips]*2),(([MealsA]*0.75)*[#People]*[#Trips]))
I keep getting "The expression you entered has a function containing the
wrong number of arguments."
Thanks for your help.
Carol
 
S

Sprinks

Since you have a close paren after the conditional test expression, Access is
interpreting your call as one parameter. Also, since multiplication doesn't
require parentheses, and you needn't enclose each parameter in parentheses,
you can simplify the call to:

=IIf([#Days]>=2,[MealsA]*0.75*[#People]*[#Trips]*2,[MealsA]*0.75*[#People]*[#Trips])

Hope that helps.
Sprinks
 
C

CCross

Thank you so much-works wonderful.

Sprinks said:
Since you have a close paren after the conditional test expression, Access is
interpreting your call as one parameter. Also, since multiplication doesn't
require parentheses, and you needn't enclose each parameter in parentheses,
you can simplify the call to:

=IIf([#Days]>=2,[MealsA]*0.75*[#People]*[#Trips]*2,[MealsA]*0.75*[#People]*[#Trips])

Hope that helps.
Sprinks

CCross said:
I need help with the following statement.
=IIf([#Days]>=2),(([MealsA]*0.75)*[#People]*[#Trips]*2),(([MealsA]*0.75)*[#People]*[#Trips]))
I keep getting "The expression you entered has a function containing the
wrong number of arguments."
Thanks for your help.
Carol
 
S

Steve Schapel

Carol,

By the way, as a side issue, it is not a good idea to use a # as part of
the name of a field or control.
 
Top