Best Answer 2017 Q1

0

Please login or register to vote for this query.

(click on this box to dismiss)

Salesforce

Q&A for Salesforce administrators, implementation experts, developers and anybody in-between

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, 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