Q&A for professional and enthusiast programmers
;with x as ( select cast(cast(datepart(year, CreationDate) as varchar) + '-' + cast(datepart(month, CreationDate) as varchar) + '-01' as datetime) as period, * from users ) select period, count(1) from x group by period order by period