Top N values per category
Posted on 2003-02-24
I'm using Access 97 and I'm trying to creat a query that gives me the top N values per category for a very simple table I have. The table contains one row per day per city, and what I need is to be able to pick the top 2 Total values per city for a certain period of time (say a week, or a month). So for example, I would have 7 Total values per city for a week, and I would like to keep the top 2 (not summed, just the 2 rows per city). The table structure is as follows:
Date City Total
... ... ...
I have looked everywhere and the only thing I found was how to create a top values per group report (Microsoft Knowledge Base), but this gives me a report, not a query. Any help will certainly be appreciated.