Q&A about the site for administrators, end users, developers and designers for Craft CMS
SELECT q.Id AS QuestionID, q.CreationDate, q.Score AS NetScore, (SELECT COUNT(*) FROM Votes AS v WHERE v.PostId = q.Id AND v.VoteTypeId = 2) AS Upvotes, (SELECT COUNT(*) FROM Votes AS v WHERE v.PostId = q.Id AND v.VoteTypeId = 3) AS Downvotes FROM Posts AS q WHERE q.PostTypeId = 1 -- Only questions AND q.CreationDate BETWEEN '2024-03-14' AND '2024-03-28' ORDER BY q.CreationDate;