Questions and answers this week

0

Please login or register to vote for this query.

(click on this box to dismiss)

Movies and TV

Q&A for movie and tv enthusiasts

DECLARE @lastWeek DATETIME = DATEADD(day,-7, GETDATE());

SELECT
(
    SELECT COUNT(*)
    FROM Posts
    WHERE PostTypeId = 1 AND
          CreationDate >= @lastWeek
) AS [Number of Questions],
(
    SELECT COUNT(*)
    FROM Posts
    WHERE PostTypeId = 2 AND
          CreationDate >= @lastWeek
) AS [Number of Answers],
(
    SELECT COUNT(*)
    FROM Votes
    WHERE VoteTypeId = 2 AND -- Upvotes
          CreationDate >= @lastWeek
) AS [Number of Upvotes]

Enter Parameters

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