Select Datediff(year, p.CreationDate, Current_Timestamp)...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Writing Meta

Q&A about the site for the craft of professional writing, including fiction, non-fiction, technical, scholarly, and commercial writing

Select  Datediff(year, p.CreationDate, Current_Timestamp) as Age, 
convert(DECIMAL(10,2), sum(case when p.AcceptedAnswerId is NULL   then 1
                                       else 0
                                  end))as sumAccepted,
       convert(DECIMAL(10,2), sum(case when p.AcceptedAnswerId is NULL then 1
                                       else 0
                                  end)
               ) / count(p.Id) as PercentAccepted
From Posts p
Where p.PostTypeId = 1
Group by Datediff(year, p.CreationDate, Current_Timestamp)
Order by Datediff(year, p.CreationDate, Current_Timestamp) desc

Enter Parameters

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