G
ghostman via AccessMonster.com
I have this Query SQL: (based on 2 tables: Training Record and Training
Sessions)....
SELECT [Training Record].TSID, [Training Record].TraineeID, [Training Record].
NoShow, [Training Sessions].ModuleName, [Training Sessions].SessionDate,
[Training Sessions].InstructorID
FROM [Training Sessions] INNER JOIN [Training Record] ON [Training Sessions].
TSID=[Training Record].TSID
WHERE ((([Training Record].TraineeID) In (SELECT TraineeID FROM [Training
Record] WHERE NoShow=True GROUP BY TraineeID HAVING COUNT >2)) AND ((
[Training Record].NoShow)=True));
...that displays NOSHOW records 3 and above. But the results are for all
TRAINEES. Just like this:
TraineeID TSID ModuleName SessionDate InstructorID NoShow
8651354 101-LVR-11-08 Furniture 101 8/11/2009 100015 Yes
8762548 101-LVR-11-08 Furniture 101 8/11/2009 100015 Yes
8753545 101-LVR-11-08 Furniture 101 8/11/2009 100015 Yes
8651354 101-MAS-20-08 Furniture 101 8/20/2009 100015 Yes
8651354 102-MRA-30-08 Furniture 101 8/30/2009 100015 Yes
How can i make the query display ONLY the records of the TRAINEE(S) who have
3 or more NOSHOWS? just like this:
TraineeID TSID ModuleName SessionDate InstructorID NoShow
8651354 101-LVR-11-08 Furniture 101 8/11/2009 100015 Yes
8651354 101-MAS-20-08 Driving 101 8/20/2009 100015 Yes
8651354 101-MRA-30-08 Safety 101 8/30/2009 100015 Yes
Sessions)....
SELECT [Training Record].TSID, [Training Record].TraineeID, [Training Record].
NoShow, [Training Sessions].ModuleName, [Training Sessions].SessionDate,
[Training Sessions].InstructorID
FROM [Training Sessions] INNER JOIN [Training Record] ON [Training Sessions].
TSID=[Training Record].TSID
WHERE ((([Training Record].TraineeID) In (SELECT TraineeID FROM [Training
Record] WHERE NoShow=True GROUP BY TraineeID HAVING COUNT >2)) AND ((
[Training Record].NoShow)=True));
...that displays NOSHOW records 3 and above. But the results are for all
TRAINEES. Just like this:
TraineeID TSID ModuleName SessionDate InstructorID NoShow
8651354 101-LVR-11-08 Furniture 101 8/11/2009 100015 Yes
8762548 101-LVR-11-08 Furniture 101 8/11/2009 100015 Yes
8753545 101-LVR-11-08 Furniture 101 8/11/2009 100015 Yes
8651354 101-MAS-20-08 Furniture 101 8/20/2009 100015 Yes
8651354 102-MRA-30-08 Furniture 101 8/30/2009 100015 Yes
How can i make the query display ONLY the records of the TRAINEE(S) who have
3 or more NOSHOWS? just like this:
TraineeID TSID ModuleName SessionDate InstructorID NoShow
8651354 101-LVR-11-08 Furniture 101 8/11/2009 100015 Yes
8651354 101-MAS-20-08 Driving 101 8/20/2009 100015 Yes
8651354 101-MRA-30-08 Safety 101 8/30/2009 100015 Yes