I have a query that counts how many results are in each branch out of 5000 rows. I am trying to condense even further and only show the Top 2 Branches in every State (so should reflect 100 results, theoretically). Is there a way to get this done?
[CODE=sql]
SELECT Format(a.[Month End DT],"mm/""01""/yy") AS Date_ID, a.STATE, a.Branch, Count(a.Branch) AS Branch_Totals
FROM [January Population] AS a
GROUP BY a.STATE, a.Branch, a.[MONTH END DT][/CODE]
[CODE=sql]
SELECT Format(a.[Month End DT],"mm/""01""/yy") AS Date_ID, a.STATE, a.Branch, Count(a.Branch) AS Branch_Totals
FROM [January Population] AS a
GROUP BY a.STATE, a.Branch, a.[MONTH END DT][/CODE]
Comment