Dividing by Zero value

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
 
W

Wayne-I-M

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)?
 
H

Hector

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top