Crystal XI - SQL 2005
I have several hundred invoice records and under each invoice record is a listing of deliveries in numerical order (1,2,3,etc). I need to pull the last delivery for each invoice, but ultimately I need to sort the report by delivery location (city). The final result is to be able to calculate the number of deliveries to each 'final' delivery location (city).
Sample data (as seen in the detail section):
Invoice City Stop
1234567 Chicago 1
1234567 Oswego 2
1234567 Pontiac 3 (last delivery)
Any advice on the best way to accomplish this?
I have several hundred invoice records and under each invoice record is a listing of deliveries in numerical order (1,2,3,etc). I need to pull the last delivery for each invoice, but ultimately I need to sort the report by delivery location (city). The final result is to be able to calculate the number of deliveries to each 'final' delivery location (city).
Sample data (as seen in the detail section):
Invoice City Stop
1234567 Chicago 1
1234567 Oswego 2
1234567 Pontiac 3 (last delivery)
Any advice on the best way to accomplish this?