datediff

0

Please login or register to vote for this query.

(click on this box to dismiss)

Vi and Vim Meta

Q&A about the site for people using the vi and Vim families of text editors

SELECT
AVG(CAST(DATEDIFF(SECOND, p.CreationDate, a.CreationDate) AS BIGINT)) AS avg_secs
FROM Posts p
INNER JOIN Posts a ON a.id = p.AcceptedAnswerId
WHERE p.AcceptedAnswerId IS NOT NULL
AND datepart(year, p.CreationDate) = 2017

Enter Parameters

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