Number of open, closed and deleted questions by month

1

Please login or register to vote for this query.

(click on this box to dismiss)

It shows the stats only until the last completely dumped month to the SEDE.

Earth Science

Q&A for those interested in the geology, meteorology, oceanography, and environmental sciences

DECLARE @TsNow DATETIME;

SELECT @TsNow = DATEFROMPARTS(
  DATEPART(yyyy, MAX(CreationDate)),
  DATEPART(mm, MAX(CreationDate)),
  1)
FROM Posts;

SELECT
  DATEFROMPARTS(
    DATEPART(yyyy, CreationDate),
    DATEPART(mm, CreationDate),
    1) AS Month,
  COUNT(DeletionDate) AS Deleted,
  COUNT(CASE
    WHEN DeletionDate IS NOT NULL OR ClosedDate IS NOT NULL THEN 1
    ELSE NULL
  END) AS ClosedOrDeleted,
  COUNT(*) AS AllQuestions
FROM PostsWithDeleted
WHERE
  PostTypeId=1
  AND
  CreationDate < @TsNow
GROUP BY DATEFROMPARTS(
    DATEPART(yyyy, CreationDate),
    DATEPART(mm, CreationDate),
    1)
ORDER BY Month

Enter Parameters

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