Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Division by zero Post Reply Post New Topic
Author Message
crystalbeg
Newbie
Newbie


Joined: 30 Oct 2012
Online Status: Offline
Posts: 15
Quote crystalbeg Replybullet Topic: Division by zero
     Posted: 13 Nov 2012 at 3:34am
Dear all,

i'm getting a division by zero error on the formula below..anyone know why?

IF ISNULL({Totalbudget})then 0 else (({@Expenditures}*100)/{totalbudget})

Thanks in advance. rgs, CB

MK
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 13 Nov 2012 at 3:44am
you are setting NULL total budgets to 0 and you cannot use 0 as a denominator.
 
IF ISNULL({Totalbudget}) or {Totalbudget}=0 then 0 else (({@Expenditures}*100)/{totalbudget})


Edited by DBlank - 13 Nov 2012 at 3:44am
IP IP Logged
crystalbeg
Newbie
Newbie


Joined: 30 Oct 2012
Online Status: Offline
Posts: 15
Quote crystalbeg Replybullet Posted: 13 Nov 2012 at 4:31am
Worked perfectly! Thank you very much!!

Best regards,
Cb
MK
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