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, datepart(year,question.creationdate), 
DATEDIFF(day, question.creationdate, asnswer.creationdate) 
FROM posts question 
inner join posts asnswer 
on question.AcceptedAnswerId = asnswer.id
where datepart(year,question.creationdate) = 2017
and DATEDIFF(day, question.creationdate, asnswer.creationdate) > 0

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




--datepart(year,creationdate) = @x

Enter Parameters

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