Count of posts by week

1

Please login or register to vote for this query.

(click on this box to dismiss)

Physical Fitness Meta

Q&A about the site for physical fitness professionals, athletes, trainers, and those providing health-related needs

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