If then to get percentage rate.

cstuckey

Registered User.
Local time
Today, 02:44
Joined
Mar 6, 2000
Messages
23
Now I have a simple calculation in a field to set the percentage rate of value and commission. Of course if the value is zero then I get an #Error in the rate field. When that happens can you tell me how to set the criteria to change the field to zero?

Thanks,
Chris
 
Try the iif function.

ex:

FieldPercentage: iif([Denominator] = 0, 0, [Numerator]/[Denominator])

This should avoid the division by 0 error.
 
It's not working. It's telling me "you have entered an invalid identifier. it's highlighting at rate: if (
 
The function is iif (with two "i") not if.
 
Yes, I know I tried both way's and no luck. Here is my calculation.

rate: iif([value]=0, 0, [commission]/[value])
 
If this expression is in the controlsource of a control, you need to preceed the expression with an equal sign.

=iif([value] = 0, 0, [commission] / [value])

I would NOT use Value as a field name since it is a property of a control and will cause confusion. And that may be what is happening here.
 

Users who are viewing this thread

Back
Top Bottom