Crystal Reports & SQL Reporting Services Training Consultants
Account Log in:
Username:
Password:
Do not seek to follow in the footsteps of the wise. Seek what they sought
 
Basho
Institute of IT Trainers - Freelance Trainer of the Year 2006 & 2009
Liverpool Business Connect Member
  Maximum Impact Solutions Limited - Reporting Solutions, Creating Answers
Reporting Solutions - Creating Answers, Crystal Reports, Dashboarding (Xcelsius) & SQL Reporting Services

The Maximum Impact Solutions Blog Feed ME!!!!

26
April

How Do I Resolve the Divide by Zero Issue in Crystal Reports?

A client of mine emailed a report, designed in Crystal Reports XI, that when compiled produced a "Divide by Zero" error message. 

When looking at the report,  the formula generating the error message was in the format:

= {Tablename.Fieldname1}/{Tablename.Fieldname2}


When creating formulas, that use a division operator, it is always advisable to consider the possibility that the demoninator field  value may be zero:


To get around this problem, the formula was modified to:

=IF  {Tablename.Fieldname2} = 0
THEN 0
ELSE  {Tablename.Fieldname1}/{Tablename.Fieldname2}

1

Julie Jackson

08
June
THANK YOU!
2

Rajon Sikder

28
November
Nice
3

LOHITH

14
January
I'm used this formula i got the error. Error is "DIVISION BY ZERO".How to make it correct this formula. if ({ado.LOPDays}>0) then {ado.BasicPay}/({@WagePrd}-{ado.LOPDays})*{@WagePrd} else if ({ado.DaysWorked}>0) then {ado.BasicPay} else if ({ado.MonthlyNetSalary}=0) then {ado.Basic Wages}
4

Julia

19
August
The issue with your formula is that the formula field{@WagePrd} is returning a zero value.
5

Alkesh Trivedi

04
January
Usefull , Thanks
6

Kevin

14
February
Thanks!

MAKE A COMMENT

Name *

Email Address *

Comment *

To prove you are human what is:

47 + 90 =