How to select TOP 5

RenaG

Registered User.
Local time
Today, 16:07
Joined
Mar 29, 2011
Messages
166
I have a query that pulls from 4 tables. Here is the select statement it generated:
SELECT tblIndividualSurvey.Location, tblQuestions.Question, tblAnswers.Answer, Count(tblQuestions.QNumber) AS CountOfQNumber
FROM tblQuestions INNER JOIN (tblIndividualSurvey INNER JOIN (tblAnswers INNER JOIN tblResponse ON tblAnswers.AID = tblResponse.AID) ON tblIndividualSurvey.ISID = tblResponse.ISID) ON (tblQuestions.QID = tblResponse.QID) AND (tblQuestions.QID = tblAnswers.QID)
WHERE ((([tblresponse.aid] Mod 3)=0) AND ((tblAnswers.AID)>14))
GROUP BY tblIndividualSurvey.Location, tblQuestions.Question, tblAnswers.Answer
ORDER BY tblIndividualSurvey.Location, Count(tblQuestions.QNumber) DESC;
I need to limit the result to the top 5 "Answers" for each Location. Any suggestions on how I can do that?

TIA!
 
Thanks Bob. The user decided that she wanted to see all the data so for the time being, I don't need to do a TOP 5 (I appreciate the link though and have bookmaked it for future use). She did thow me another curve which I will post in a new thread.
 

Users who are viewing this thread

Back
Top Bottom