Q&A about the site for professional robotic engineers, hobbyists, researchers and students
Select (DATEPART(month, creationdate)-1.00)/12+DATEPART(year, creationdate) as [Month], count(*) as [Count], sum(case when deletiondate is null then 1 else 0 end) as [Open], sum(case when deletiondate is null then 0 else 1 end) as [Deleted] from postswithdeleted group by (DATEPART(month, creationdate)-1.00)/12+DATEPART(year, creationdate) order by [Month]