Number of questions/answers/posts per month

1

Please login or register to vote for this query.

(click on this box to dismiss)

Law Meta

Q&A about the site for legal professionals, students, and others with experience or interest in law

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?2021-01-01##') AND (p.CreationDate <= '##Date2?2023-01-01##')
GROUP BY eomonth(p.CreationDate)
ORDER BY eomonth(p.CreationDate)

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results