qryTeamPtsScaled:
SELECT Q1.D1, Q1.TeamAbbrev, Q1.EventAbbrev, tblPts.Pts AS Scale, Q1.Championship
FROM qryTeamPtsSub AS Q1, tblPts
WHERE (((
SELECT COUNT(*) FROM qryTeamPtsSub AS Q2
WHERE Q2.Raw >= [Q1].[raw] AND Q2.D1 = Q1.D1 AND Q1.EventID = Q2.EventID)=[tblPts].[position]) AND tblPts.ScoreID=3)
ORDER BY Q1.D1, Q1.TeamAbbrev, Q1.EventAbbrev;
qryTeamPtsSub:
SELECT tblTeam.D1, tblTeam.TeamAbbrev, Sum(qryTeamRaw.Pts) AS Raw, tblEvent.EventAbbrev, tblEvent.EventID, tblEvent.Championship
FROM tblTeam INNER JOIN
(tblEvent INNER JOIN
(tblRace INNER JOIN
(tblRider INNER JOIN qryTeamRaw ON tblRider.RiderID = qryTeamRaw.RiderID)
ON tblRace.RaceID = qryTeamRaw.RaceID)
ON tblEvent.EventID = tblRace.EventID)
ON tblTeam.TeamAbbrev = tblRider.TeamAbbrev
GROUP BY tblTeam.D1, tblTeam.TeamAbbrev, tblEvent.EventAbbrev, tblEvent.EventID, tblEvent.Championship;
|