SELECT AVG( CAST ( (DATEDIFF(year, p1.CreationDate, p2.C...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Music Fans

Q&A for music historians, critics, and fans

SELECT AVG(
       
       CAST (
       (DATEDIFF(year, p1.CreationDate, p2.CreationDate)*31536000) +
       
       (DATEDIFF(month, p1.CreationDate, p2.CreationDate)*2629746) +
       
       (DATEDIFF(day, p1.CreationDate, p2.CreationDate)*86400) +
       
       (DATEDIFF(hour, p1.CreationDate, p2.CreationDate)*3600) +
       
       (DATEDIFF(minute, p1.CreationDate, p2.CreationDate)*60) +
        
        DATEDIFF(second, p1.CreationDate, p2.CreationDate)
        
          as BIGINT
         )
        )
        
        -- Cast(Column AS BIGINT)
FROM Posts p1
JOIN Posts p2
  on p1.AcceptedAnswerId = p2.Id
WHERE Year(p1.CreationDate) = '2017' 
and p1.AcceptedAnswerId is not null

Enter Parameters

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