Number of answers in past 30 days to questions older than 60 days

0

Please login or register to vote for this query.

(click on this box to dismiss)

Home Improvement

Q&A for contractors and serious DIYers

SELECT COUNT(*)
FROM Posts as p1
Join Posts as p2
ON p1.ParentId = p2.Id
WHERE p1.PostTypeId = 2 --post is an answer
AND p1.CreationDate >= DATEADD(DAY,-30,GETDATE()) --posted within last 30 days
AND p1.ParentId IS NOT NULL --post has a parent
AND p2.PostTypeId = 1 --posts parent is a question
AND p2.CreationDate <= DATEADD(DAY, -60, GETDATE()) --posts parent question is older than 60 days

Enter Parameters

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