I am having problem getting desired results from the second part of the
query with a subquery. My query looks like this.
SELECT tblSurveyResponse.SurveyID, tblSurveyResponse.SurveyEditionID,
tblSurveyResponse.QuestionID
FROM LkupQuestions INNER JOIN tblSurveyResponse ON
LkupQuestions.QuestionID = tblSurveyResponse.QuestionID
GROUP BY tblSurveyResponse.SurveyID, tblSurveyResponse.SurveyEditionID,
tblSurveyResponse.QuestionID
HAVING (((tblSurveyResponse.SurveyID) In (Select S.SurveyID from
tblSurvey S inner join tblSurveyEditions SE on S.SurveyID =
se.SurveyID group by S.SurveyID having Count(*) 1 )));
This part works fine. This gives me a result set that looks like this.
Survey SurveyEdition Question SurveyResponse
1 1 1 1
1 2 1 2
2 1 1 7
2 2 2 3
>From this result set I want to pick up the questions that exits in morethan one survey edition for a given survey. In this case it would Be
Question 1 and Survey 1 since Question 1 exists in both the editions of
Survey 1.
I donot seem to create a query that will retrieve this result set.
Any help would be appreciated.