Haber te pongo mi prueba y resultado, no se de donde sacas un '*' en la instruccion no hay ninguno.
Código SQL:
Ver originalSELECT Route, Version, Leg, DATE, MIN(TIME) AS inicial, MAX (TIME) AS final FROM
(SELECT ruta AS Route,version AS Version,leg AS Leg,CONVERT(DATE,fecha_agendada,105) AS DATE,CONVERT(VARCHAR,fecha_agendada,108)AS TIME
FROM #temporal AS r
GROUP BY ruta,version,leg,fecha_agendada) AS T1
GROUP BY Route, Version, Leg, DATE
ORDER BY route, version
Route Version Leg Date inicial final
TS50 3 1 2012-09-22 13:00:00 13:30:01
TS91 0 1 2012-09-22 12:00:00 12:30:01
TS91 13 1 2012-09-22 14:00:00 14:30:01