[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 565
  • Last Modified:

Top N values per category

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.
0
LizzyB
Asked:
LizzyB
  • 2
1 Solution
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
Hum, must have missed it in the MSKB:

ACC: How to Create a Top N Values per Group Query
http://support.microsoft.com/default.aspx?scid=kb;en-us;153747

ACC2000: How to Create a "Top N Values Per Group" Query
http://support.microsoft.com/default.aspx?scid=kb;en-us;210039

Jim.
0
 
LizzyBAuthor Commented:
Ok, I knew I was short-sighted, but I didn't think I was BLIND!!  Jim, you get the points for finding it for me, thanks sooooo much!
0
 
LizzyBAuthor Commented:
Short and to the point.  Did I mention QUICK !?!?
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now