respree
Active Member
- Joined
- Apr 14, 2003
- Messages
- 258
Hello. I'm not sure if Access can do this, but I'm trying to write a query that will find the next and previous sequential records in a table.
SKU is given, PREVIOUS and NEXT are calculated based on SKU.
If calculated properly, it would look something like this:
SKU PREVIOUS NEXT
B0587159901 B0587159979 B058715991X
B058715991X B0587159901 B0587159928
B0587159928 B058715991X B0587159936
B0587159936 B0587159928 B0587159944
B0587159944 B0587159936 B0587159952
B0587159952 B0587159944 B0587159960
B0587159960 B0587159952 B0587159979
B0587159979 B0587159960 B0587159901
Note: For the first record (SKU), the PREVIOUS field would show the last record. For the last record (SKU), the NEXT field would show the first record.
Can anyone think of a way to do this. I'm not sure even where to start.
Any help would be greatly appreciated.
SKU is given, PREVIOUS and NEXT are calculated based on SKU.
If calculated properly, it would look something like this:
SKU PREVIOUS NEXT
B0587159901 B0587159979 B058715991X
B058715991X B0587159901 B0587159928
B0587159928 B058715991X B0587159936
B0587159936 B0587159928 B0587159944
B0587159944 B0587159936 B0587159952
B0587159952 B0587159944 B0587159960
B0587159960 B0587159952 B0587159979
B0587159979 B0587159960 B0587159901
Note: For the first record (SKU), the PREVIOUS field would show the last record. For the last record (SKU), the NEXT field would show the first record.
Can anyone think of a way to do this. I'm not sure even where to start.
Any help would be greatly appreciated.