Accepted answers to questions old more than a period


Please login or register to vote for this query.

(click on this box to dismiss)


Q&A for community managers, administrators, and moderators

-- Shows answers scored > 0 to questions old more than 6 months
-- ResultCount: Number of results to display

SELECT TOP ##ResultCount:int##
       q.Id as [Post Link],
       q.Score as [Question scored],
       u.Id as [User Link],
       q.CreationDate as [Asked on],
       a.Id as [Post Link],
       a.Score as [Answer scored],
       q.CreationDate as [Answered on],
       au.Id as [User Link]
       FROM Posts q
       JOIN Posts a ON a.Score > 0
       JOIN Users u ON q.OwnerUserId = u.Id
       JOIN Users au ON a.OwnerUserId = au.Id
       WHERE q.PostTypeId = 1
             AND DATEDIFF(month, q.CreationDate, GETDATE()) >= 6
             ORDER BY q.Id DESC

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results