Q&A about the site for members of the workforce navigating the professional setting
SELECT eomonth(p.CreationDate) [month], COUNT(p.Id) AS [Total Posts], SUM(case when p.PostTypeId = 1 then 1 else 0 end) AS [Total Questions], SUM(case when p.PostTypeId = 2 then 1 else 0 end) AS [Total Answers] FROM Posts p WHERE p.CreationDate >= '##Date1?2015-01-01##' AND p.CreationDate <= '##Date2?2021-01-01##' GROUP BY eomonth(p.CreationDate) ORDER BY eomonth(p.CreationDate)