I have a table that has these fields
CarID
Car Initials
Car Number
Customer
CustomerBegin
CustomerEnd
There will be a row for each time a customer is in posession of a car. For example:
CarID carinitials carnumber customername customerbegin customerend
4968 TCLX 1004 Customer 6/25/18 7/31/2020
4968 TCLX 1004 Customer 8/1/20 10/31/2020
4968 TCLX 1004 Customer 11/1/20 12/31/2021
There will be thousands of rows like that and for each car I want to just get the record with the most recent date in customerend. I am thinking I must need to do some kind of sub query. I have tried using top but it doesnt seem to work right.
I need the query to just give me the red line for each Car.
Thanks for any help.