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 Mike Lewis 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.
Sep 12, 2005
448
US
Hi All
cr 9.0
ms sql

i have this group terri
900 and 600 are sum(current value,terri1)
here are my value
territory Id territory Name current prior % change
E01 PC-E01 900 600

and have this formula
if
sum({@Prior_Contribution},{TRANSACTION_HISTORY.TERR1}) = 0
then
0
else
100-(sum({@Prior_Contribution},{TRANSACTION_HISTORY.TERR1})/sum({@Current_Contribution},{TRANSACTION_HISTORY.TERR1})*100)

i get error division by 0
i check to make sure that the prior as a value = 0
what could be the problem????????????
thanks


Durango122
if it moves and should not used Duck Tape
if does not move and should used WD-40
 
This is zero:

sum({@Current_Contribution},{TRANSACTION_HISTORY.TERR1})

Change the formula to:

if
sum({@Current_Contribution},{TRANSACTION_HISTORY.TERR1} = 0
then
0
else
100-(sum({@Prior_Contribution},{TRANSACTION_HISTORY.TERR1})/sum({@Current_Contribution},{TRANSACTION_HISTORY.TERR1})*100)

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top