SELECT p1.Id, p1.CreationDate, p2.Id, p2.CreationDate, (D...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Ask Patents Meta

Q&A about the site for people interested in improving and participating in the patent system

SELECT p1.Id, p1.CreationDate, 
       p2.Id, p2.CreationDate, 
       (DATEDIFF(year, p1.CreationDate, p2.CreationDate) +
       DATEDIFF(month, p1.CreationDate, p2.CreationDate) +
       DATEDIFF(day, p1.CreationDate, p2.CreationDate) +
       DATEDIFF(hour, p1.CreationDate, p2.CreationDate) +
       DATEDIFF(minute, p1.CreationDate, p2.CreationDate) +
       DATEDIFF(second, p1.CreationDate, p2.CreationDate)) as calculatedDiff
FROM Posts p1
JOIN Posts p2
  on p1.AcceptedAnswerId = p2.Id
WHERE Year(p1.CreationDate) = '2017' 
and p1.AcceptedAnswerId is not null
order by calculatedDiff DESC

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results