Total Posts, Comments, Answers by Week for Bigcommerce tag

0

Please login or register to vote for this query.

(click on this box to dismiss)

Robotics Meta

Q&A about the site for professional robotic engineers, hobbyists, researchers and students

DECLARE @weeks int         = ##weeks:int?52##
DECLARE @aSunday DATE = '2000-01-02'

SELECT
  dateadd(week, datediff(week, @aSunday, q.CreationDate), @aSunday) week,
  t.TagName,
  count(q.Id) as PostCount
FROM PostTags pt
INNER JOIN Posts q ON q.Id=pt.PostId
INNER JOIN Tags t ON t.Id=pt.TagId
WHERE
  TagName like '%bigcommerce%' AND
  q.CreationDate < dateadd(week, datediff(week, @aSunday, getdate()), @aSunday) AND
  q.creationdate between Dateadd(ww, -@weeks, getdate()) AND Dateadd(ww, -1, getdate())
GROUP BY dateadd(week, datediff(week, @aSunday, q.CreationDate), @aSunday), TagName
ORDER BY dateadd(week, datediff(week, @aSunday, q.CreationDate), @aSunday)

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results