I am using Access 2010 and have tried to search for an answer to the following question without success. I came across stuff that was too obscure for me - and none that specifically talked about earliest/latest dates.
I need to build a query that will show all the fields for each customer but limited to first 5 transaction dates. In this case, the query result will have 15 rows (5 for each customer) - based on earliest transaction dates for each customer - grouped by customer (each customer's first 5 transaction dates are not necessarily the same).
I also need 2 other queries: one that will sum the first 5 date based transaction amounts grouped by customer (a summary query) and one that sums "left over" transactions (transactions that occurred on 6th and later transaction dates) - also grouped by customer.
No VBA, please.
All help will be greatly appreciated!
<tbody>
</tbody>
I need to build a query that will show all the fields for each customer but limited to first 5 transaction dates. In this case, the query result will have 15 rows (5 for each customer) - based on earliest transaction dates for each customer - grouped by customer (each customer's first 5 transaction dates are not necessarily the same).
I also need 2 other queries: one that will sum the first 5 date based transaction amounts grouped by customer (a summary query) and one that sums "left over" transactions (transactions that occurred on 6th and later transaction dates) - also grouped by customer.
No VBA, please.
All help will be greatly appreciated!
CustomerID | OrderID | OrderDate | Amount |
1 | 1 | 1/1/15 | 200 |
1 | 2 | 1/6/15 | 300 |
2 | 3 | 1/2/15 | 50 |
1 | 4 | 1/3/15 | 60 |
3 | 5 | 1/2/15 | 900 |
2 | 6 | 1/9/15 | 400 |
1 | 7 | 1/12/15 | 300 |
3 | 8 | 1/3/15 | 100 |
2 | 9 | 2/1/15 | 200 |
1 | 10 | 2/2/15 | 66 |
3 | 11 | 2/15/15 | 90 |
2 | 12 | 2/11/15 | 500 |
2 | 13 | 2/9/15 | 100 |
1 | 14 | 2/9/15 | 300 |
3 | 15 | 2/28/15 | 250 |
1 | 16 | 2/27/15 | 444 |
2 | 17 | 2/16/15 | 700 |
3 | 18 | 2/20/15 | 300 |
3 | 19 | 1/19/15 | 650 |
2 | 20 | 1/30/15 | 125 |
3 | 21 | 1/1/15 | 700 |
<tbody>
</tbody>