Accepted answers to questions old more than a period

0

Please login or register to vote for this query.

(click on this box to dismiss)

Android Enthusiasts

Q&A for enthusiasts and power users of the Android operating system

-- Shows accepted answers 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],
       a.CreationDate as [Answered on],
       au.Id as [User Link]
       FROM Posts q
       JOIN Posts a ON q.AcceptedAnswerId = a.Id
       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, a.CreationDate) >= 6
             ORDER BY q.Id DESC

Enter Parameters

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