All weekly counts

0

Please login or register to vote for this query.

(click on this box to dismiss)

Genealogy and Family History Meta

Q&A about the site for expert genealogists and people interested in genealogy or family history

DECLARE @endDate DATE = GETDATE();

SELECT 
    DATEADD(WEEK, DATEDIFF(WEEK, 0, CreationDate), 0) AS WeekStart,
    COUNT(*) AS PostCount
FROM Posts
WHERE PostTypeId = 1 -- 1 for questions, 2 for answers
AND CreationDate <= @endDate
GROUP BY DATEADD(WEEK, DATEDIFF(WEEK, 0, CreationDate), 0)
ORDER BY WeekStart;

Enter Parameters

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