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 John Tel 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

Status
Not open for further replies.

Dukester0122

IS-IT--Management
Mar 18, 2003
587
US
Tried several times to get rid of the 'division by zero' error but nothing seemed to work. My original formula was:
Sum ({AVSOPHDR.DEPRECVD}, {@territory}) / Sum ({AVSOPHDR.DOCAMNT}, {@territory}) * 100

then tried this

if Sum ({AVSOPHDR.DEPRECVD}, {@territory}) / Sum ({AVSOPHDR.DOCAMNT}, {@territory}) * 100 > 0

then Sum ({AVSOPHDR.DEPRECVD}, {@territory}) / Sum ({AVSOPHDR.DOCAMNT}, {@territory}) * 100

else 0

still was getting the error
 
Try This:

if Sum ({AVSOPHDR.DOCAMNT}, {@territory}) = 0 then
0
else
Sum ({AVSOPHDR.DEPRECVD}, {@territory}) / Sum ({AVSOPHDR.DOCAMNT}, {@territory}) * 100

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top