This query fetches the amount of questions asked per month, organized by month and year. Modified to sort by year first.
Q&A about the site for members of the workforce navigating the professional setting
-- Total of questions asked per month -- This query fetches the amount of questions asked per month, organized by year and month. SELECT datepart(month,CreationDate) as month, datepart(year,CreationDate) as year, COUNT(id) as total FROM Posts WHERE PostTypeId = 1 GROUP BY datepart(month,CreationDate), datepart(year,CreationDate) ORDER BY datepart(year,CreationDate), datepart(month,CreationDate)