Afternoon,I have two queries that I would like to combine into one. One query I do manually every quarter and one I found by using the search.The first one shows me just the months in the quarter:SELECT January = SUM(CASE WHEN DATENAME(month, testdate) ='January' THEN 1 ELSE 0 END),February = SUM(CASE WHEN DATENAME(month, testdate) ='February' THEN 1 ELSE 0 END),March = SUM(CASE WHEN DATENAME(month, testdate) ='March' THEN 1 ELSE 0 END)FROM dbo.tblHealth
The second one gives me the total for the quarter we are in:SELECT SUM(DATEPART(q, testdate))FROM dbo.tblHealth
Is there a way to combine the two so I can say show me all the months in quarter 4 without using the case statement? What she wants is just to show the three months for that quarter.Any help you can provide would be great.ThanksLaura