Código SQL:
Ver originalSELECT * FROM
(
SELECT
RIGHT('00' + RTRIM(CONVERT(CHAR, DATEPART(HOUR,fecha_registro))), 2) + ':' + RIGHT('00' +
RTRIM(CONVERT(CHAR, FLOOR(DATEPART(MINUTE, fecha_registro) / 15) * 15)), 2) AS CUARTOHORA,
SUM(CASE WHEN trafico = 'Contestada' THEN 1 ELSE 0 END) AS CONTESTADO,
SUM(CASE WHEN trafico = '' THEN 1 ELSE 0 END) AS ABANDONADO,
SUM(CASE WHEN trafico = 'Contestada' THEN 1 ELSE 0 END) + SUM(CASE WHEN trafico = '' THEN 1 ELSE 0 END) AS RECIBIDO
FROM registro_trafico
WHERE fecha_registro BETWEEN '2010-11-22 00:00:00' AND '2010-11-28 23:59:59'
)t1
GROUP BY cuartohora
Saludos!