20 Percent of the whole participant:SELECT TOP 20 PERCENT Participant.ParticipantID, Participant.FirstName, Participant.LastNameFROM Participant ORDER BY Rnd(ParticipantID);
20 percent of the people who took survey 1SELECT TOP 20 PERCENT P.ParticipantIDFROM Participant AS P INNER JOIN [Participant-SurveyDetail] AS PS ON P.ParticipantID = PS.ParticipantID WHERE (((PS.SurveyID)=1)) ORDER BY Rnd([p].[ParticipantID]);
People who did not take any survey at all:SELECT P.ParticipantIDFROM Participant AS P LEFT JOIN [Participant-SurveyDetail] AS PS ON P.ParticipantID = PS.ParticipantIDWHERE (((PS.ParticipantID) Is Null))
A query to let you know who took what:SELECT P.ParticipantID, [ParticipantID] In (SELECT ParticipantID FROM [Participant-SurveyDetail] as PS WHERE PS.SurveyID = 1) AS HasTakenSurvey1, [ParticipantID] In (SELECT ParticipantID FROM [Participant-SurveyDetail] as PS WHERE PS.SurveyID = 2) AS HasTakenSurvey2, [ParticipantID] In (SELECT ParticipantID FROM [Participant-SurveyDetail] as PS WHERE PS.SurveyID = 3) AS HasTakenSurvey3, [ParticipantID] In (SELECT ParticipantID FROM [Participant-SurveyDetail] as PS WHERE PS.SurveyID = 4) AS HasTakenSurvey4 FROM Participant AS P;
How many times did those who took surveys take them?:SELECT [Participant-SurveyDetail].SurveyID, [Participant-SurveyDetail].ParticipantID, Count(*) AS NumberOfTakesFROM [Participant-SurveyDetail]GROUP BY [Participant-SurveyDetail].SurveyID, [Participant-SurveyDetail].ParticipantID;
I hope that gives you a good start...~ Shaun MerrillSeattle, WA