SELECT YEAR(EntryDate) AS 'Year', MONTH(EntryDate) AS 'Month', COUNT(*) AS monthly_Case_count
FROM dbo.SP_Case WHERE YEAR(EntryDate)=2011
GROUP BY YEAR(EntryDate), MONTH(EntryDate)
ORDER BY YEAR(EntryDate), MONTH(EntryDate);
SELECT COUNT(*) FROM dbo.SP_Case
WHERE YEAR(EntryDate)=2011 AND MONTH(EntryDate)=2
No comments:
Post a Comment