Access query help

PaulCL

New Member
Joined
Jul 9, 2014
Messages
43
What would the access query be if I wanted only the top 3 firmNames for each change in market in my table(Crab Market Share) with their total volume displayed.
Thanks
Market FirmName Total Volume

ALBAL Joes Crabs 1,000
ALBAL Freds Crabs 2,000
.
.
.
.
ALDOT Sams Crabs 1,500
ALDOT Walt's Crabs 3,000
.
.
.
ALALB xxxxxx xxxxx
...
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
it needs a field to show it changed, like [DateStamp]
ALBAL Joes Crabs 1,000, 9/1/15
ALBAL Freds Crabs 2,000, 9/1/15
...
ALDOT Sams Crabs 1,500, 8/31/15
ALDOT Walt's Crabs 3,000, 8/31/15

now we can collect the top N of each mkt change using this datestamp. Do you have that?
what marks the Mkt Change?
 
Upvote 0
it needs a field to show it changed, like [DateStamp]
ALBAL Joes Crabs 1,000, 9/1/15
ALBAL Freds Crabs 2,000, 9/1/15
...
ALDOT Sams Crabs 1,500, 8/31/15
ALDOT Walt's Crabs 3,000, 8/31/15

now we can collect the top N of each mkt change using this datestamp. Do you have that?
what marks the Mkt Change?

I do not. How do I add an unique identifier to my query? The market change is the different 240 regions i.e. ALBAL, ALDOT, ALAUB...
 
Upvote 0
I do not. How do I add an unique identifier to my query? The market change is the different 240 regions i.e. ALBAL, ALDOT, ALAUB...
 
Upvote 0
ranman256: do you think a totals query that contains a subquery clause (e.g. SELECT DISTINCT Market FROM [Crab Market Share) would solve the issue? Or maybe query a query that uses the same sql?

PaulCL: the top 3 firmNames - do you mean the firmNames for the top 3 'Total Volume' values?
Also, if you're going to entirely quote someone else's post, please enclose it in quote tags (see reply toolbar) otherwise, it's more difficult to read.
 
Last edited:
Upvote 0
This board's 10 minute edit policy is ROYAL PITA. I lost my changes in the middle of an edit.
While checking my terminology (subquery) I came across this here Microsoft Access tips: Subquery basics
Code:
SELECT Orders.CustomerID, Orders.OrderDate, Orders.OrderID
FROM Orders
WHERE Orders.OrderID IN
   (SELECT TOP 3 OrderID                            
   FROM Orders AS Dupe                              
   WHERE Dupe.CustomerID = Orders.CustomerID        
   ORDER BY Dupe.OrderDate DESC, Dupe.OrderID DESC) 
ORDER BY Orders.CustomerID, Orders.OrderDate, Orders.OrderID;

So it looks like what I said is doable if I understand both the need and the method.
 
Upvote 0
Thanks... I'm looking for the top 3 FirmNames for each 240 regions based on Total Volume.
 
Upvote 0
OK. So the posted sql should work if you can modify it to your table/field names. Give it a try! You will learn more by doing.;)
 
Upvote 0

Forum statistics

Threads
1,221,847
Messages
6,162,380
Members
451,760
Latest member
samue Thon Ajaladin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top