SELECT TOP 1 T.acKey
FROM tHR_Trvl T 
JOIN thr_trvlItem I ON I.acKey = T.acKey  
JOIN vHR_SetTrvlVehicle V ON V.acCarRegNo = T.acCarRegNo  
WHERE  T.acCarRegNo = @CarRegNo 
AND ((adDateHourFrom > @DateStart AND adDateHourFrom < @DateEnd) OR (adDateHourTo > @DateStart AND adDateHourTo < @DateEnd)
	OR (adDateHourFrom <= @DateStart AND adDateHourTo >= @DateEnd))
AND T.acKey <> @AcKey
AND (V.acCompanyCar = 'T' OR V.acIsRented = 'T')