Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Reports / Printing / July 2007

Tip: Looking for answers? Try searching our database.

In Access what expression do I use to average a field ignoring 0?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dan Test - 30 Jul 2007 22:26 GMT
I have a report that calculates the average of a requested field. The average
is not correct due to "0" values in some of the records. What expression do I
use in the Control Source to ignore the 0 entries? I tried to adapt the one I
use in Excel but did not get the results I was looking for.
Thanks for the help.
Jeff Boyce - 30 Jul 2007 23:17 GMT
Consider stepping back and doing the selection and averaging in a query on
which you then base your report.

If you don't wish to include rows whose value in the field is 0, exclude
them from the query.

Regards

Jeff Boyce
Microsoft Office/Access MVP

>I have a report that calculates the average of a requested field. The
>average
[quoted text clipped - 4 lines]
> use in Excel but did not get the results I was looking for.
> Thanks for the help.
John Spencer - 31 Jul 2007 01:13 GMT
If you want zero excluded from the calculation, then use a formula like

   Avg(IIF(SomeField=0,Null,SomeField))

'====================================================
 John Spencer
 Access MVP 2002-2005, 2007
 Center for Health Program Development and Management
 University of Maryland Baltimore County
'====================================================

> I have a report that calculates the average of a requested field. The average
> is not correct due to "0" values in some of the records. What expression do I
> use in the Control Source to ignore the 0 entries? I tried to adapt the one I
> use in Excel but did not get the results I was looking for.
> Thanks for the help.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.