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 MikeeOK 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 1

Status
Not open for further replies.

tcolebu

MIS
Aug 24, 2004
6
US
I have a large query with a handful of "#error" cells because I am trying to divide by ZERO. This causes a problem in my report. Is there any property that I can change so that it is set to a NULL or ZERO (or something similar to that). Thanks.
 
Have a look at the IIf function.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
SELECT Table2.DeptID, Table2.DivBy, [DeptID]/IIf([DivBy]=0,[DeptID],[DivBy]) AS Result
FROM Table2;

This will convert those errors to a result of 1.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top