Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Division by zero error

Status
Not open for further replies.

JCAA

MIS
Jun 22, 2003
65
US
I get a division by zero error on the following query as [OH Qty] consist of null values. How can I change it so that null is 0 (That will get rid of my division by zero error right?)?

MonthlyDemand: [OH Qty]/[UsageQty]

Thanks!!!
 
I meant that some of the [UsageQty] are null
 
Hi JCAA,

To replace Null with Zero use NZ([UsageQty]).

However ..

Expressions involving Null resolve as Null, so Nulls are not causing your division by zero error. Using NZ as above could well trigger explicit division by zero and is more likely to cause a problem than cure one.

I suggest you look again at your errors to try to identify the real cause, and also decide what result you want to see when you you do have null (or zero).

Enjoy,
Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top