Tente substituir:
SUM(H_TIME) AS HANDLE_TIME
por :
MEDIAN(H_TIME) AS HANDLE_TIME
(linha 3)
EDIT:Para os meses, substitua:
select
MONTH, WEEK, DAY,
Por:
select
MONTH,
E:
GROUP BY
MONTH
,WEEK
,DAY
Por:
GROUP BY
MONTH
Para as semanas, substitua:
select
MONTH, WEEK, DAY,
Por:
select
MONTH, WEEK,
E:
GROUP BY
MONTH
,WEEK
,DAY
Por:
GROUP BY
MONTH
,WEEK