#Error Results in Query

S

Sherry N.

Hello,
I expect my query to return some #Error results b/c there is division
involved with 0. What I would like to do is create some kind of statement in
the criteria that would say If result "#Error", then result should be "0".
Any help greatly appreciated.

Thanks.
 
K

Ken Snell [MVP]

Use an IIf function to produce a zero when the divisor is zero. If you show
us an example of the calculation in your query, we can suggest an example of
such IIf usage.
 
O

Ofer

You can check the field you dividing on, and if it equal to zero then return
zero, else run the devision

IIf(FieldName=0,0,Field2Name/FieldName)
 
Top