Average number of undeleted questions per day per month since site inception

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

DECLARE @now DATETIME = GETDATE();

SELECT
  DATETIMEFROMPARTS(YEAR(CreationDate), MONTH(CreationDate), DAY(CreationDate), 0, 0, 0, 0) AS [Date],
  COUNT(*) AS [Count]
FROM Posts
WHERE PostTypeId = 1 -- question
  AND CreationDate < DATETIMEFROMPARTS(YEAR(@now), MONTH(@now), DAY(@now), 0, 0, 0, 0)
GROUP BY YEAR(CreationDate), MONTH(CreationDate), DAY(CreationDate)
ORDER BY [Date]

Enter Parameters

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