Skip to content

Instantly share code, notes, and snippets.

@MarioCares
Created February 24, 2014 11:21
Show Gist options
  • Save MarioCares/9186663 to your computer and use it in GitHub Desktop.
Save MarioCares/9186663 to your computer and use it in GitHub Desktop.
Listado Cantidad Atenciones, Por Mes
SELECT month(xfecha) AS MES, DATEPART(hh, xfecha) AS HORA, count(*)
FROM [XSAPU].[dbo].[Atenciones]
where id_sapu = 4 and CAST(xfecha as datetime) between '20130601' and '20131231'
group by month(xfecha), DATEPART(hh, xfecha)
order by MES, HORA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment