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

Sorting percentage month by month in access

P: 5
Hi, previously John did give me a fabulous answer on how to find a percentage of answers that rated 4 or more. I would now like to know if it is possible to have these percentages split into the months they are entered under (the table has this data recorded. I am not a computer tech, so be warned ;)

For the previous posts code please see http://bytes.com/topic/access/answer...value-4-higher
Jul 29 '12 #1

✓ answered by NeoPa

You should really share the data structure you're using to ask a question like this Anna. Presumably, you have a field in your table that represents this month value somehow. If we call that [MonthVal] for now, just to illustrate, then your query would need to be grouped by this field. Something like :
Expand|Select|Wrap|Line Numbers
  1. SELECT   [MonthVal]
  2.        , Count(*) AS [Total]
  3.        , Sum(IIf([StatusLevel]>=4,1,0)/[Total] AS [FourOrMore]
  4. FROM     [tblPeople]
  5. GROUP BY [MonthVal]

Share this Question
Share on Google+
1 Reply


NeoPa
Expert Mod 15k+
P: 31,418
You should really share the data structure you're using to ask a question like this Anna. Presumably, you have a field in your table that represents this month value somehow. If we call that [MonthVal] for now, just to illustrate, then your query would need to be grouped by this field. Something like :
Expand|Select|Wrap|Line Numbers
  1. SELECT   [MonthVal]
  2.        , Count(*) AS [Total]
  3.        , Sum(IIf([StatusLevel]>=4,1,0)/[Total] AS [FourOrMore]
  4. FROM     [tblPeople]
  5. GROUP BY [MonthVal]
Jul 30 '12 #2

Post your reply

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