Testing

0

Please login or register to vote for this query.

(click on this box to dismiss)

Craft CMS Meta

Q&A about the site for administrators, end users, developers and designers for Craft CMS

--declare @x INT = 2018 
SELECT question.AcceptedAnswerId Years, 
DATEDIFF(day, question.creationdate, asnswer.creationdate)*24 ResponseInDays,
count(*) HowManyQuestion 
FROM posts question 
inner join posts asnswer 
on question.AcceptedAnswerId = asnswer.id
where datepart(year,question.creationdate) = 2018
and DATEDIFF(day, question.creationdate, asnswer.creationdate) >= 0
group by question.AcceptedAnswerId,
DATEDIFF(day, question.creationdate, asnswer.creationdate)
order by question.AcceptedAnswerId,
DATEDIFF(day, question.creationdate, asnswer.creationdate)
desc

--order by DATEDIFF(day, question.creationdate, asnswer.creationdate) desc




--datepart(year,creationdate) = @x

Enter Parameters

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