How do I find the mode of a range of numbers in a field in Access

G

Guest

I am keeping a track of a survey with a range of 1-5 with 5 being the
highest. I would like my report to show what response was most frequent of
one of the questions. So if I had 5 people and 3 of them responded with a 4
and 2 of them reponded with a 3, I want the report to say that for this
statement 4 was the most common response.
 
G

Guest

How do you want to handle ties - i.e. if multiple scores appear the same max
no. of times? The following will return all scores which appear the max no.
of times:

Q1: SELECT Score, Count(*) AS HowMany
FROM YourTable
GROUP BY Score ORDER BY Count(*) DESC;

Q2: SELECT Score, HowMany
FROM Q1
WHERE HowMany = (SELECT MAX(HowMany) From Q1);

Q2 will return the result you want.
 

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