I came to investigate the options that I would need to make, however, I believe that the method I use is the simplest:
SELECT COUNT(*), DATEADD(dd, DATEDIFF(dd, 0, date_field),0) as dtgroup FROM TABLE GROUP BY DATEADD(dd, DATEDIFF(dd, 0, date_field),0) ORDER BY dtgroup ASC;
Jefferson Silva May 21 '15 at 18:24 2015-05-21 18:24
source share