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 Westi 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 2

Status
Not open for further replies.

cyreports

Programmer
May 12, 2010
89
US
I am gettiing a Division by Zero error on this and not sure how to fix, I thought I had, but guess not.

Code:
if SUM({Data.InsPayment}) + SUM({Data.PatPayment}) = 0 then 0
else 
(SUM({Data.InsPayment}, {@Group3}) + SUM({Data.PatPayment}, {@Group3})) % (SUM({Data.InsPayment}, {@Group2}) + SUM({Data.PatPayment}, {@Group2}))
 
if (SUM({Data.InsPayment}, {@Group2}) + SUM({Data.PatPayment}, {@Group2})) = 0 then
0 else
(SUM({Data.InsPayment}, {@Group3}) + SUM({Data.PatPayment}, {@Group3})) % (SUM({Data.InsPayment}, {@Group2}) + SUM({Data.PatPayment}, {@Group2}))

You have to test whether the denominator is 0.

-LB
 
Your formula is not checking the sums at the group level (i.e., if SUM({Data.InsPayment}, {@Group3}) + SUM({Data.PatPayment}, {Group2}) = 0 then 0).
 
Cyreports, I just just noticing the similarity of your user name and the fields you are checking on. Any chance this is a report for Centricity Physician Office Practice Management?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top