Count of posts by week

1

Please login or register to vote for this query.

(click on this box to dismiss)

Christianity

Q&A for committed Christians, experts in Christianity and those interested in learning more

WITH Raw AS (
  SELECT
    DATEADD(dd,
      7 * FLOOR(DATEDIFF(day, '1970-01-05', CreationDate) / 7),
      '1970-01-05') AS PostWeek,
    Id
  FROM Posts
)
SELECT
  PostWeek,
  COUNT(*) AS Count
FROM Raw
GROUP BY PostWeek
ORDER BY PostWeek;

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results