alexfwalker81
Member
- Local time
- Yesterday, 23:13
- Joined
- Feb 26, 2016
- Messages
- 93
Due to a quirk of our hateful website, multiple delivery address orders are split into separate orders, despite the fact that they are one transaction. To be able to analyse the data in access, I really need to understand transactions, rather than orders as the number of orders is misleading. Below is a simplified version of how the data is structured;
What I'd like to be able to do, probably in a function I suppose, is to be able to identify where the customer number changes and assign a transaction ID, like this;
In a sense, I guess what I'm asking for is similar to subtotals in Excel.
I can't use the Customer Number itself, as this will appear repetitively later in the data. I must sort the data by order number, then identify the transaction when the customer number changes.
How would I be able to achieve this?
Customer Number | Order Number |
1234567 | 345678 |
1234567 | 345679 |
1234567 | 345680 |
6789100 | 345681 |
6789100 | 345682 |
What I'd like to be able to do, probably in a function I suppose, is to be able to identify where the customer number changes and assign a transaction ID, like this;
Customer Number | Order Number | Transaction ID |
1234567 | 345678 | 1 |
1234567 | 345679 | 1 |
1234567 | 345680 | 1 |
6789100 | 345681 | 2 |
6789100 | 345682 | 2 |
In a sense, I guess what I'm asking for is similar to subtotals in Excel.
I can't use the Customer Number itself, as this will appear repetitively later in the data. I must sort the data by order number, then identify the transaction when the customer number changes.
How would I be able to achieve this?