Hello,
I just want everyone to know this is an X-post from Reddit where I have not received a response. This post will be updated if I receive a solution there and visa versa. I've been trying to solve my problem by reading other posts and http://allenbrowne.com/subquery-01.html#TopN but I'm not successful at applying this logic to my query.
I usually work in excel, but my data files that I'm using have become very large. I brought the file into access so my computer can better handle it. In my job we have several companies and orders in each company. I need to identify the top 10 orders per company by dollar amount.
In Excel I would make a pivot table, add my fields and then select top 10 from the drop down menu. How can I get the same results in a Query in Access?
Here is a short example of what I'm looking to do:
My table, named "Day2", looks something like this:
Company, Order, Amount
1, 123, $100
1, 124, $250
1, 125, $200
1, 126, $130
2, 223, $250
2, 224, $120
2, 225, $300
How could I make access return me the top 2 orders per company? I'd like my query results to look like:
Company, Order, Amount
1, 124, $250
1, 125, $200
2, 223, $250
2, 225, $300
I'd really love to understand the logic behind the query. I can read the basics of SQL where you SELECT the column FROM the table WHERE this criteria is met. The more complicated sub queries confuse me a little.
Thank you in advance!