Full Version: Top 20 most answered questions
UtterAccess Discussion Forums > Microsoft® Access > Access Queries
greenlee
Hi,

I have a database that contains various tables (These are a stripped down version of the tables)

tbl_question
questionID
question

tbl_response
responseID
questionID
clientID
response

tbl_client
clientID
clientInfo


I need to get the top 20 questions that have been answered the most times. I thought using COUNT would work til I realized it didn't work the way I thought it did.
I could certainly use some help figuring this out...
RAZMaddaz
Try the following:

SELECT TOP 20 tbl_response.question_ID, Count(tbl_response.question_ID) AS CountOfquestion_ID
FROM tbl_response
GROUP BY tbl_response.question_ID;
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.