Answers with best score created within 3 month range for the reward

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

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

Enter Parameters

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