(select Convert(char(8), DATEADD(SECOND, AVG(DATEDIFF(SECOND, 0, CONVERT(TIME, CONVERT(varchar(23), (CONVERT(varchar(5), DATEDIFF(s, DateAdd( HOUR, 0, f.Qc_sdate), DateAdd( HOUR