Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Divide by Zero error Post Reply Post New Topic
Author Message
deanw
Newbie
Newbie
Avatar

Joined: 20 Nov 2012
Location: United Kingdom
Online Status: Offline
Posts: 2
Quote deanw Replybullet Topic: Divide by Zero error
     Posted: 20 Nov 2012 at 12:50am
I am not very technically minded but can do basic crystal projects.

I have a report written for me, which is now giving me an issue.

When I run the report, I am getting a Divide by Zero error and I cannot work out why.

The error is in the following formula:-

(Sum ({@Payments}, {aps_case_v.dt_instruct}, "monthly")/Sum ({@Invoice}, {aps_case_v.dt_instruct}, "monthly"))/100

Any advice greatly appreciated!

IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 20 Nov 2012 at 1:07am
Hi
 
Try this :
if Sum ({@Invoice}, {aps_case_v.dt_instruct}, "monthly") <> 0 then
(Sum ({@Payments}, {aps_case_v.dt_instruct}, "monthly")/Sum ({@Invoice}, {aps_case_v.dt_instruct}, "monthly"))/100
else
0
Thanks,
Sastry
IP IP Logged
deanw
Newbie
Newbie
Avatar

Joined: 20 Nov 2012
Location: United Kingdom
Online Status: Offline
Posts: 2
Quote deanw Replybullet Posted: 20 Nov 2012 at 1:55am
That works perfectly - thank you very much.

I love this forum!

IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum