Up-to-date content: Average amount of hours between question posed and answered

0

Please login or register to vote for this query.

(click on this box to dismiss)

Software Engineering

Q&A for professionals, academics, and students working within the systems development life cycle

SELECT bla.Month,
       MAX([Average amount of hours between question posed and answered])
FROM (
      SELECT Month = DATEADD(MONTH, DATEDIFF(MONTH, 0, p.CreationDate), 0),
             'Average amount of hours between question posed and answered' = AVG(DATEDIFF(hour, p1.CreationDate, p.CreationDate))
      FROM Posts p
      INNER JOIN Posts p1 ON p.Id = p1.AcceptedAnswerId
      GROUP BY DATEADD(MONTH, DATEDIFF(MONTH, 0, p.CreationDate), 0)
     ) AS bla
     GROUP BY Month
ORDER BY Month

/*
'Up-to-date content' = 1 - [Average amount of hours between question posed and answered] / 
*/

Enter Parameters

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