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

Ignore zeros when averaging

Status
Not open for further replies.

DonHind

Programmer
Joined
Dec 25, 2001
Messages
4
Location
US
I have a report that summarizes lab data. Occasionally they do not run all the tests and a field will have a zero in it. When I average on the report I would like to ignore the zeros. I tried to do IIF function in the summation field like Excel does on columns to ignor zeros, but the report would not run, said the report was too complicated. Can I do something to the query that feeds the report, perhaps convert zeros to null, since the average function ignors zeros?
 
Do the average calculation manually, i.e. SUM the column and divide it by a DCOUNT, which will let you count only those records that have a value greater than 0 for your field.

[pc2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top