Q&A for students, researchers and practitioners of computer science
select *, count(*) from ( select CAST( cast(DATEPART(YYYY, CreationDate) as varchar) + '-' + cast(DATEPART(MM, CreationDate) as varchar) + '-01' as datetime) [Month], CAST(DATEPART(YYYY, ClosedDate) as varchar) [Closed] from Posts p where CreationDate >= ##startdate:string## ) as X group by [Month], [Closed] order by [Month] asc