Get time from post-answer by AngularJS by Year

0

Please login or register to vote for this query.

(click on this box to dismiss)

Poker Meta

Q&A about the site for serious players and enthusiasts of poker

DECLARE @tagName NVARCHAR(255) = 'angularjs'
-- TagName: Tag name of the question.
DECLARE @beginDate DATETIME = '2016-01-01'
DECLARE @endDate DATETIME = '2020-12-31'
DECLARE @yearSelected INT = '2016'


  SELECT (DATEDIFF(SECOND,{d '1970-01-01'}, c.CreationDate)) - (DATEDIFF(SECOND,{d '1970-01-01'}, p.CreationDate)) as timeP, YEAR(c.CreationDate) as 'yearp'
  from posts p left join posts c on (p.id = c.ParentId)
  join PostTags pt ON p.Id = pt.PostId
  join Tags t ON t.Id = pt.TagId
  WHERE (p.PostTypeId = 1) AND (YEAR(c.CreationDate) = @yearSelected)  AND (t.TagName = @tagName)
  AND (p.CreationDate BETWEEN @beginDate AND @endDate)

Enter Parameters

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