Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dividing by zero 1

Status
Not open for further replies.

jschill2628

Programmer
Nov 3, 2009
156
US
Hello,

I am having a little trouble. I have sums in my report footers.
{#Precursor} and {#Serious}. I also have a formula in my report footer: {#Precursor}/{#Serious}.

the problem comes when my user chooses a time frame where there may be a zero count for the {#Serious), thus you are dividing by zero.

I tried to create the following formula:
if {#Serious} = 0 then "0" else
({#Precursor}/{#Serious})

but crystal highlights the second line, and tells me I need a string. Can someone smarter then me tell me what is wrong with my formula.

Thanks in advance!!!
 
Try:

If {#Serious} = 0
Then 0
Else ({#Precursor}/{#Serious})

or

If {#Serious} <> 0
Then ({#Precursor}/{#Serious})


Regards
Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top