Posts by week

0

Please login or register to vote for this query.

(click on this box to dismiss)

Chess

Q&A for serious players and enthusiasts of chess

SELECT 
  1.000*datepart(year,p.CreationDate)+1.000*datepart(week,p.CreationDate)/52 as [date],
  Cast(PostTypeId as Char),
  count(Id)
FROM PostsWithDeleted p
WHERE 
  p.PostTypeId in (1,2) AND 
  p.CreationDate BETWEEN '2014'+'-01-01' AND '2019'+'-10-27'
  and p.ClosedDate is null
GROUP BY 
  1.000*datepart(year,p.CreationDate)+1.000*datepart(week,p.CreationDate)/52,
  PostTypeId
ORDER BY 
  PostTypeId,1.000*datepart(year,p.CreationDate)+1.000*datepart(week,p.CreationDate)/52

Enter Parameters

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