By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,930 Members | 1,465 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,930 IT Pros & Developers. It's quick & easy.

Average across a row?

P: 1
I have a table of ratings (integers that can be blank - or a positive int) for a list of unique clients. I want to run a query that will add a new column simply averaging my ratings. I used to just add them up manually like (table!rate1+table!rate2+table!rate3)/3 but I now need to ignore blank ratings, so I don't have a constant value to divide by...

Is there an easy way to do this with one of the build in access functions? I can't seem to get Avg to do it...
Dec 2 '08 #1
Share this Question
Share on Google+
2 Replies

Expert 2.5K+
P: 2,653

You will definitely benefit from reading
this article

Kind regards,
Dec 2 '08 #2

Expert 100+
P: 1,287
Try with 2 calculated fields in your query:
Count: iif(isnull(rate1),0,1) + iif(isnull(rate2),0,1) + iif(isnull(rate3),0,1)
Avg: (rate1+rate2+rate3)/[Count]
Dec 3 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.