SQLTeam.com | Weblogs | Forums

How to write a query to Show the gross revenue for the quarters and entire year

Show the gross revenue for the quarters and entire year

SELECT
   date
   , CASE
         WHEN MONTH(date) BETWEEN 7 AND 9 THEN 'First Quarter'
         WHEN MONTH(date) BETWEEN 10 AND 12 THEN 'Second Quarter'
         WHEN MONTH(date) BETWEEN 1 AND 3 THEN 'Third Quarter'
         WHEN MONTH(date) BETWEEN 4 AND 6 THEN 'Fourth Quarter'
     END AS quarter
FROM Stuff

Thank you very much :pray::pray: