DECLARE @DaysInThePast int = ##DaysInThePast:int?30## SE...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

DECLARE @DaysInThePast int = ##DaysInThePast:int?30##

SELECT TOP 50 FORMAT (CreationDate, 'yyyy-MM-dd') as PostDay, p.OwnerUserId--, COUNT(1) as cnt
FROM Posts p
WHERE p.PostTypeId = 2
 -- AND DATEDIFF(DAY, PostDay, CURRENT_TIMESTAMP) <= @DaysInThePast
--GROUP BY p.Date, p.OwnerUserId
--ORDER BY CreationDate DESC

Enter Parameters

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