select datepart(year, uba.[Answer Creation Date]) as [Yea...


Please login or register to vote for this query.

(click on this box to dismiss)

Audio-Video Production Meta

Q&A about the site for engineers, producers, editors, and enthusiasts spanning the fields of video, and media creation

select datepart(year, uba.[Answer Creation Date]) as [Year],
 datepart(month, uba.[Answer Creation Date]) as [Month],
 count(uba.[Owner]) as [High Rated Answers Count]
from (select min(a.CreationDate) as [Answer Creation Date], 
        count(*) as [Upvotes Count],
        min(a.OwnerUserId) as [Owner]
      from Votes v
      inner join Posts a on v.PostId = a.Id
      inner join Posts q on a.ParentId = q.Id 
      where v.VoteTypeId = 2
        and a.PostTypeId = 2
        and datediff(day, a.CreationDate, v.CreationDate) <= 20
        and (select count(*)
             from PostTags pt
             inner join Tags t on pt.TagId = t.Id
             where pt.PostId = q.Id
               and t.TagName = '##tagName##') > 0
      group by v.PostId) uba
where uba.[Upvotes Count] >= 5
group by datepart(year, uba.[Answer Creation Date]),
  datepart(month, uba.[Answer Creation Date])
order by [Year], [Month]

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results