Q&A for apps, scripts, and development with the Stack Exchange API
SELECT AVG(CAST(DATEDIFF(MINUTE, p.CreationDate, a.CreationDate) AS BIGINT)) FROM Posts p INNER JOIN Posts a ON a.id = p.AcceptedAnswerId WHERE p.AcceptedAnswerId IS NOT NULL AND datepart(year, p.CreationDate) = 2017