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


Joined: 24 Feb 2015
Location: United States
Online Status: Offline
Posts: 3
Quote ldodge Replybullet Topic: Error: Division by zero
     Posted: 16 Oct 2015 at 10:14am
The following formula works in most circumstances except when 0/0, and I get an error "division by zero"

(({#CS Primary}) / ({#Total Deliveries} - {#VBAC Successful} - {#CS Repeat})) * 100

ex.) 0 / 4-0-4 * 100

What can I do?
IP IP Logged
praveeng
Senior Member
Senior Member
Avatar

Joined: 11 Jul 2011
Online Status: Offline
Posts: 165
Quote praveeng Replybullet Posted: 18 Oct 2015 at 8:57pm
Hi,

Use below logic:

If ({#Total Deliveries} - {#VBAC Successful} - {#CS Repeat}) = 0 Then
0
Else
(({#CS Primary}) / ({#Total Deliveries} - {#VBAC Successful} - {#CS Repeat})) * 100

--Praveen G
Praveen Guntuka,
praveen_guntuka@yahoo.com
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