StarhawkGamer
Programmer
I have two tables, 1 has a list of agents, the other is quality control surveys for all agents. is there a way in Access to get the last 10 QAs for each agent in a single query?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
AND ( SELECT COUNT(*)
FROM surveys
WHERE agentID = s.agentID
AND surveydate > s.surveydate ) < 10
SELECT Agents.[Advocate ID], QA.[SessionID], QA.[FATAL IR]
FROM Agents
INNER JOIN QA
ON QA.[UNIT ID] = Agents.[Advocate ID]
AND ( SELECT COUNT(*)
FROM QA
WHERE [UNIT ID] = QA.[UNIT ID]
AND [Survey Date] QA.[Survey Date]) < 10;
FROM Agents
INNER
JOIN QA [green]AS foo[/green]
ON [red]([/red]
[green]foo[/green].[UNIT ID] = Agents.[Advocate ID]
AND ( SELECT COUNT(*)
FROM QA
WHERE [UNIT ID] = [green]foo[/green].[UNIT ID]
AND [Survey Date] > QA.[Survey Date] ) < 10
[red])[/red]
SELECT Agents.[Advocate ID], foo.[SessionID], foo.[FATAL IR]
FROM Agents
INNER JOIN QA as foo
ON (
foo.[UNIT ID] = Agents.[Advocate ID]
AND ( SELECT COUNT(*)
FROM QA
WHERE [UNIT ID] = foo.[UNIT ID]
AND [SURVEY DATE] > qa.[SURVEY DATE]) < 10);