Answers with best score created within 3 month range

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 @From DATETIME = convert(DATETIME, '##StartDate?2015-07-01##')
DECLARE @To DATETIME = dateadd(mm, 3, @From)

SELECT TOP ##Count:int?50## A.Id AS [Post Link], 
  A.CreationDate AS Created, U.Id AS [User Link], A.Score AS [Answer Score], 
  Q.Score AS [Question Score], Q.ViewCount AS Views
FROM
  Posts A
  INNER JOIN Posts Q ON A.ParentId = Q.Id
  INNER JOIN Users U on A.OwnerUserId = U.Id
WHERE
  A.PostTypeId = 2 AND
  A.CreationDate BETWEEN @From AND @To
ORDER BY A.Score DESC

Enter Parameters

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