Q&A about the site for members of the workforce navigating the professional setting
with Date as (
SELECT CAST('2012-6-20' as date) DateId
SELECT DATEADD(day, 1, DateId)
WHERE DATEADD(day, 1, DateId) <= '2012-7-25'
Comments2 as (
SELECT Id,PostId,CONVERT(date, CreationDate) as cDate
d.DateId, c.PostId, Count(c.Id) as CommentCount
from Date d LEFT JOIN Comments2 c
where d.DateId >= '2012-07-22' AND d.DateId <= '2012-07-25'
group by d.DateId, c.PostId
order by d.DateId asc, Count(c.Id) desc