DECLARE @UID int = ##UserId## DECLARE @STYear int = ##S...

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

-- date range of post ##min_date## , ##max_date##
-- user id ##userid##

DECLARE @UID int = ##UserId##
DECLARE @STYear int =  ##StartYear##
DECLARE @STMonth int =  ##StartMonth##
DECLARE @YearSpan int = ##ToYear##
DECLARE @MonthSpan int = ##ToMonth##

DECLARE @BEGINING datetime = datefromparts(@STYear, @STMonth, 1)
DECLARE @ENDING datetime = datefromparts(@YearSpan, @MonthSpan, 1)

select CreationDate, Score, ViewCount, Title
from Posts
where OwnerUserId = @UID and CreationDate  > @Begining and CreationDate < @Ending and PostTypeId = 1
order by CreationDate

Enter Parameters

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