Top answers for tag from previous month

0

Please login or register to vote for this query.

(click on this box to dismiss)

It lists all questions where an answer was edited or created within the last calendar month. It is using LastActivityDate on the Answer which appears to also include comments. The question must have a score of one or more (which it gets by default) and the answer must have 2 or more (which means at least one additional upvote). Includes questions where there is no accepted answer yet.

Stack Overflow

Q&A for professional and enthusiast programmers

select top 100
     q.id as [Post Link]
   , q.Title
   , q.score as [Q Score]
   , a.score as [A Score]
   , cast(case when q.AcceptedAnswerId = a.id then 1 else 0 end as bit) as Accepted
   , a.LastActivityDate as [Answer Activity Date]
   , q.answercount as [Answers]
   , q.tags as [Tags]
from posts q 
inner join posttags pt 
      on pt.postid = q.id
inner join tags t 
      on t.id = pt.tagid
inner join string_split(##tags:string?delphi,extjs,lansa##,',') sel 
      on lower(sel.value) = lower(t.tagname)
inner join posts a
      on a.ParentId = q.id
where 
1=1 -- simplifies predicate editing
and a.PostTypeId = 2 -- Answer
and a.LastActivityDate between -- one month before end of last month 
  DateAdd(month, -1,  DateAdd(month, DateDiff(month, 0,GetDate()), -1))  
  and DateAdd(month, DateDiff(month, 0,GetDate()), -1) -- End of Last Month
and a.score > 1
and q.score >= 1
--and q.acceptedanswerid is not null
order by a.score desc

Enter Parameters

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