Average Calculations

R

Robert

I need to create a query that will give me averages on a list of numbers.

How can I calculate the averages, but ignore 0 or null values. Addtionally
if I am ignoreing the 0 value I don't want the record field to factored in
the average count.

e.g.

5
0
2
4

In this senario I would want the averages to be be caluated on the 3 records
with values in excess of 0., 5+2+4=11 11/3 =3.6

If I took the 0 value I would end up with an average of 11/4=2.75 - which is
what I don't want

Any help would be appreciated.
 
O

Ofer

Try this query

SELECT Avg(TableName.FieldName) AS AvgOfFieldName
FROM TableName
WHERE (((TableName.FieldName)<>0 And (TableName.FieldName) Is Not Null))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top