"divison by zero" error message

J

Jeff

When I try to run reports or the associated query I get a
pop-up screen telling me "divison by zero" and it won't
produce the report. Help!
 
L

Les

Go back to your query in design mode. Wherever you have a
division calculation, you should build something like the
following:

displayfld:IIF(denominatorfld = 0, 0,
numeratorfld/denominatorfld)

Division by zero is illegal. By checking denominator
ahead of time, you can just set field to 0.
 
J

Jeff

Thanks Les

Do I build it into the calculation?
-----Original Message-----
Go back to your query in design mode. Wherever you have a
division calculation, you should build something like the
following:

displayfld:IIF(denominatorfld = 0, 0,
numeratorfld/denominatorfld)

Division by zero is illegal. By checking denominator
ahead of time, you can just set field to 0.

.
 
L

Les

Yes,
In the example I listed,
the "numeratorfld/denominatorfld" represents your
calculation.
The IIF statement ends up saying, if your denominator
is 0, set the value to 0, otherwise, set the value to the
results of your calculation. Hope this helps.
 

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

Similar Threads


Top