I have a query that pulls from 4 tables. Here is the select statement it generated:
TIA!
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?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;
TIA!