Average without zeroes

message from =?Utf-8?B?WW9nZ3lzdHlsZQ==?= on 26 May 2004
I have a form with several option groups on it. The option values assigned to each are 0,1,2,3,4 and 5.
Each option group asks a question where the user will respond with 1-very low rating, 2-low rating, 3-ok rating, 4-good rating, 5-best rating or 0-N/A.
I have a report that averages these values. However, I don't want to include the 0 value for the N/A responses. Is there anyway to average the responses from an option group without including the zeroes? Can I convert to Null values? Or am I attempting the impossible?
 
Graham R Seach replied to =?Utf-8?B?WW9nZ3lzdHlsZQ==?= on 27 May 2004
Just filter out the zeros.

If you're using DAvg, then specify DAvg("myField", "myTable", "myField > 0")

If you're using Avg in a query, then specify >0 in the Criteria box. Or in
SQL, add a WHERE clause like so:
WHERE myField > 0

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.html

"Yoggystyle" <anonymous@discussions.microsoft.com> wrote in message
news:46E15ABE-0689-4343-97BD-EFDE0605BC59@microsoft.com...
to each are 0,1,2,3,4 and 5.
low rating, 2-low rating, 3-ok rating, 4-good rating, 5-best rating or
0-N/A.
include the 0 value for the N/A responses. Is there anyway to average the
responses from an option group without including the zeroes? Can I convert
to Null values? Or am I attempting the impossible?
 
=?Utf-8?B?WW9nZ3lzdHlsZQ==?= replied to Graham R Seach on 1 Jun 2004
I am working from a query because I only want specific information within a specific date range for my report. The problem with the solution provided is that I lose the other values in the query. Is there anyway to convert the 0 to null or to do a count without adding the 0?
 

Archived message: Average without zeroes (Microsoft Access)