SELECT MONTH(LastEditDate) MONTH, COUNT(*) COUNT FROM Posts

0

Please login or register to vote for this query.

(click on this box to dismiss)

Cognitive Sciences Meta

Q&A about the site for practitioners, researchers, and students in cognitive science, psychology, neuroscience, and psychiatry

SELECT MONTH(LastEditDate) MONTH, COUNT(*) COUNT
FROM Posts
WHERE YEAR(LastEditDate)=2014
GROUP BY MONTH(LastEditDate);

SELECT 
  SUM(CASE datepart(month,LastEditDate) WHEN 1 THEN 1 ELSE 0 END) AS 'January',
  SUM(CASE datepart(month,LastEditDate) WHEN 2 THEN 1 ELSE 0 END) AS 'February',
  SUM(CASE datepart(month,LastEditDate) WHEN 3 THEN 1 ELSE 0 END) AS 'March',
  SUM(CASE datepart(month,LastEditDate) WHEN 4 THEN 1 ELSE 0 END) AS 'April',
  SUM(CASE datepart(month,LastEditDate) WHEN 5 THEN 1 ELSE 0 END) AS 'May',
  SUM(CASE datepart(month,LastEditDate) WHEN 6 THEN 1 ELSE 0 END) AS 'June',
  SUM(CASE datepart(month,LastEditDate) WHEN 7 THEN 1 ELSE 0 END) AS 'July',
  SUM(CASE datepart(month,LastEditDate) WHEN 8 THEN 1 ELSE 0 END) AS 'August',
  SUM(CASE datepart(month,LastEditDate) WHEN 9 THEN 1 ELSE 0 END) AS 'September',
  SUM(CASE datepart(month,LastEditDate) WHEN 10 THEN 1 ELSE 0 END) AS 'October',
  SUM(CASE datepart(month,LastEditDate) WHEN 11 THEN 1 ELSE 0 END) AS 'November',
  SUM(CASE datepart(month,LastEditDate) WHEN 12 THEN 1 ELSE 0 END) AS 'December',
  SUM(CASE datepart(year,LastEditDate) WHEN 2012 THEN 1 ELSE 0 END) AS 'TOTAL'
FROM
    Posts
WHERE
  LastEditDate BETWEEN '2014/01/01' AND '2016/12/31'

Enter Parameters

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