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 0 in data when writing a formula

Status
Not open for further replies.

enassif

Technical User
Feb 20, 2009
3
0
0
US
Crystal Report X
Data is from access file.
I am writing a formula for getting an average cost per unit.
Some of the units in the data equal 0(zero).
How do I get the formula to ignore all 0(zeros)

Thank you for your help
 
Use an If..Then..Else statement to test for 0:

if {table.fieldB} = 0
then 0
else {table.fieldA} / {table.fieldB}

~Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top