R
Ray
I have a query that groups failures by audit type. I want it to group only
the top 5 failures for each audit type. (not just the top 5 failures)
Suggestions?
SELECT spdMainQuery.AuditType, spdFailures.Defect, Count(spdFailures.Defect)
AS Occur, Sum(spdFailures.ItemizedFailedSamples) AS [Sum]
FROM spdMainQuery LEFT JOIN spdFailures ON spdMainQuery.MainPriKey =
spdFailures.MainPriKey
GROUP BY spdMainQuery.AuditType, spdFailures.Defect
HAVING (((spdFailures.Defect) Is Not Null))
ORDER BY spdMainQuery.AuditType, Count(spdFailures.Defect) DESC;
the top 5 failures for each audit type. (not just the top 5 failures)
Suggestions?
SELECT spdMainQuery.AuditType, spdFailures.Defect, Count(spdFailures.Defect)
AS Occur, Sum(spdFailures.ItemizedFailedSamples) AS [Sum]
FROM spdMainQuery LEFT JOIN spdFailures ON spdMainQuery.MainPriKey =
spdFailures.MainPriKey
GROUP BY spdMainQuery.AuditType, spdFailures.Defect
HAVING (((spdFailures.Defect) Is Not Null))
ORDER BY spdMainQuery.AuditType, Count(spdFailures.Defect) DESC;