For each unique 'ScopeID' I would like to concatenate the 'Origin' and 'Destination' but not repeating the 'Origin' based on the previous row's 'Destination'. Example for 'ScopeID' 135, I would like to return the 'Scope' as 1875-300003-BOS-ABN and not 1875-300003-300003-BOS-BOS-ABN.
I thought that I may be able to use a loop to return all of the values for each 'Origin' and 'Destination' per each 'ScopeID' ordered by the 'StopSequence'.
Any nudges in the right direction would be great and very much appreciated.
Recordset to evaluate:
Example of values that I would like to return:
I thought that I may be able to use a loop to return all of the values for each 'Origin' and 'Destination' per each 'ScopeID' ordered by the 'StopSequence'.
Any nudges in the right direction would be great and very much appreciated.
Recordset to evaluate:
Code:
ScopeID StopSequence OriginType Origin DestinationType Destination Miles Days Hours 135 10 S 1875 S 300003 421 1 20 135 20 S 300003 H BOS 2992 5 23 135 30 H BOS H ABN 192 1 1 136 10 S 1875 S 300003 421 1 20 136 20 S 300003 H SEA 1156 2 7 136 30 H SEA H ACR 2379 4 18
Code:
ScopeID Scope 135 1875-300003-BOS-ABN 136 1875-300003-SEA-ACR
Comment