Posts (Answers) based on a given tag and a given duration


Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

select count(*) AS "NUMBER_OF_ANSWERS", 
       DATENAME(mm, p2.LastActivityDate) AS MONTH_NAME,
       DATENAME(yyyy, p2.LastActivityDate) AS YEAR,
       MONTH(p2.LastActivityDate) AS MONTH_NUM
from   Posts p2, PostTypes ptypes2
where  p2.posttypeid =
and = 2
and    p2.parentid in
        from Posts p1, PostTags ptags1, Tags t1, PostTypes ptypes1 
        where p1.posttypeid =
          and = 1
          and = ptags1.postid 
          and ptags1.tagid = 
          and t1.tagname = '##TagName##'
and   p2.creationdate >= '##startdate##'
and   p2.creationdate <= '##enddate##'
group by DATENAME(yyyy, p2.LastActivityDate), MONTH(p2.LastActivityDate), DATENAME(mm, p2.LastActivityDate)
order by DATENAME(yyyy, p2.LastActivityDate) ASC, MONTH(p2.LastActivityDate) ASC, DATENAME(mm, p2.LastActivityDate) ASC

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results