This is a tough one. Hope I can explain it.
I have one query that pulls the top 5 states from a recordset, based on the sum of a currency field. No problems there.
What I need then is the top two cities (based on sum of the same currency field) from each of the five states...hopefully returned in one query.
So I need the query to return 10 records (5 X 2). I thought I could do it with five queries (one query returning two cities for each of the five states in the original query) joined together with a union query. Having problems there, even though I thought that was the obvious solution.
Even if I could get that solution to work, it's no fun having queries that are eight queries deep. I prefer to have one well-written deal that does the job. Ya know?
Thanks for your help!
M
I have one query that pulls the top 5 states from a recordset, based on the sum of a currency field. No problems there.
What I need then is the top two cities (based on sum of the same currency field) from each of the five states...hopefully returned in one query.
So I need the query to return 10 records (5 X 2). I thought I could do it with five queries (one query returning two cities for each of the five states in the original query) joined together with a union query. Having problems there, even though I thought that was the obvious solution.
Even if I could get that solution to work, it's no fun having queries that are eight queries deep. I prefer to have one well-written deal that does the job. Ya know?
Thanks for your help!
M