Q&A about the site for expert genealogists and people interested in genealogy or family history
SELECT eomonth(q.CreationDate) [month], CAST(COUNT(DISTINCT q.Id)+COUNT(DISTINCT a.Id) AS Integer) AS [Total Posts], COUNT(DISTINCT q.Id) AS [Total Questions], COUNT(DISTINCT a.Id) AS [Total Answers] FROM Posts q INNER JOIN Posts a ON a.ParentId=q.Id GROUP BY eomonth(q.CreationDate) ORDER BY eomonth(q.CreationDate) ---a.CreationDate might be different from q.Creationdate ---I did not want to complicate the query too much and I wanted to have questions and answers in the same query