User with the most post in a week

0

Please login or register to vote for this query.

(click on this box to dismiss)

SharePoint

Q&A for SharePoint enthusiasts

SELECT TOP 1
    OwnerUserId,
    COUNT(*) AS PostCount,
    DATEPART(WEEK, CreationDate) AS Week,
    YEAR(CreationDate) AS Year
FROM
    Posts
GROUP BY
    OwnerUserId,
    DATEPART(WEEK, CreationDate),
    YEAR(CreationDate)
ORDER BY
    PostCount DESC

Enter Parameters

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