Dividing by Zero value

  • Thread starter Thread starter Hector
  • Start date Start date
H

Hector

I have two simple calculation fields in a query, the first is a field
(containing some zeros) and dividing by 10 and the second uses that value to
add to another field.
Problem is when I run it I keep getting dialog box asking to input values
for each of the fields.

I think this is due to the division by 0, how do I overcome this.
Help on this would be great.
Regards
Chris
 
To follow on from what Ken said, whilst it is possible to create a formula
that checks for non 0 numbers and, if non 0, performs some calculation I
think you have a 2nd small (simple to solve) problem.
and the second uses that value to
add to another field.

You "may" to use a sub query to get the result of the 1st calculation before
using in the 2nd. Although - may be a better method - instead of running 2
calculations why not just combine them and make 1 (unless you use the results
of the 1st calculation for something else as well)?
 
Thanks everyone, after a good nights sleep I was able to sort it out strait
away the next day.
Great support, thanks

GFB45202 said:
Why not use the following: IIf([FIELD1]=0,0,[FIELD2]/[FIELD1])


Hector said:
I have two simple calculation fields in a query, the first is a field
(containing some zeros) and dividing by 10 and the second uses that value to
add to another field.
Problem is when I run it I keep getting dialog box asking to input values
for each of the fields.

I think this is due to the division by 0, how do I overcome this.
Help on this would be great.
Regards
Chris
 
Back
Top