This one has me a stumped and I admit my SQL skills are limited at best. If I have the sets of duplicate records below except for the dates, how to query to get the result shown in the two bottom rows? Thanks in advance
From what I can see, you're looking for the earliest start date and latest d date?
SELECT A.[From], A.[To], A.Company, A.Vehicle, MIN(A.StartDate), MAX(A.EndDate) FROM dbo.ExampleTable AS A GROUP BY A.[From], A.[To], A.Company, A.Vehicle;