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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal report formula division zero error 1

Status
Not open for further replies.

dikidushi

Technical User
Jan 8, 2009
75
AW
Hi i am using crystal report v.10
i created a report and would like to make a formula for average unit price, however when creating the formula it worked fine in the report and gave me the average price for the total sales amount and total sales quantity,

here us my problem, if there is a 0.00 amount or 0.00 quantity the formula stop working and return a error ( Division by zero ) please help i need to make a statement where it say if there is 0.00 then make it 1.00 or something else so my formula can work.

any help will be great.

thanks
 
In the formula put in a check to see if denominator is zero

i.e.,
if denominator = 0 then result=1
else
result = numerator/denominator

I hope this helps.
 
Hi,
Just a slight revision, maybe:
if denominator = 0 then result=0
else
result = numerator/denominator

If 0 items were sold the average price would be 0.





[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Crystal syntax:

if denominator = 0 then
0 else
numerator/denominator

-LB

 
Oke one more help,

The report i build is by period sales
the period appear on the report as numbers i need to make it show the months and not 1,2,3 instead Jan, Feb etc.
any help will be appreciated

thnx
 
this should probably be a new topic since you have resolved the issues originally presented within this topic, but anyway...

monthname() will give you the month when a number is put between the parens.

if you have a date, you can use monthname(month({table.Datefield}))
 
Yes this should be a new post sorry for that

Thanks for the help it worked.

 
Yes this should be a new post sorry for that

Thanks for the help it worked.

 
Yes this should be a new post sorry for that

Thanks for the help it worked.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top