Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Division by zero error Post Reply Post New Topic
Author Message
swingking03
Newbie
Newbie


Joined: 13 Apr 2012
Online Status: Offline
Posts: 8
Quote swingking03 Replybullet Topic: Division by zero error
    Posted: 15 May 2012 at 4:12am
I am currently using the following formula:
if {SumOfExposure} <> 0 then (1 - ({GrosssTrades}/{LimitCash})) * 100 else 0
 
In this instance, {LimitCash} has a zero value and I am recieving the division by zero error.  How can I add an if statement to this formula where if {LimitCash} = zero then 100?
 
Thanks.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 15 May 2012 at 4:29am
if {LimitCash}=0 then 0 else
if {SumOfExposure} <> 0 then (1 - ({GrosssTrades}/{LimitCash})) * 100 else 0
IP IP Logged
swingking03
Newbie
Newbie


Joined: 13 Apr 2012
Online Status: Offline
Posts: 8
Quote swingking03 Replybullet Posted: 15 May 2012 at 5:04am
I awear I tried that and it gave me a boolean error.  Thanks so much for your help!
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.031 seconds.