Jump to content

Access Sql


Guest pac1181

Recommended Posts

Guest pac1181

I am trying to create a query in Access to Group based on locations and show the Top 10 procedures by revenue. I can get the query to group the Top 10 for all locations or just one, but not the Top 10 for each group. Not very savy with SQL and could use help. The code below produces the Top 10 for all locations, just need it to group by EACH location. Any help would be appreciatedSELECT TOP 10 Sum([temp - top 10 by loc].[sumOfOI Line Changes]) AS [sumOfSumOfOI Line Changes], [temp - top 10 by loc].[Location#], [temp - top 10 by loc].[Loc Name], [temp - top 10 by loc].[Proc Key], [temp - top 10 by loc].[Proc Name], Sum([temp - top 10 by loc].[sumOfOI Line Units]) AS [sumOfSumOfOI Line Units]FROM [temp - top 10 by loc]GROUP BY [temp - top 10 by loc].[Location#], [temp - top 10 by loc].[Loc Name], [temp - top 10 by loc].[Proc Key], [temp - top 10 by loc].[Proc Name]ORDER BY Sum([temp - top 10 by loc].[sumOfOI Line Changes]) DESC , [temp - top 10 by loc].[Location#];

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...