title: Listing all the months within a quarter using the Year and Quarter column
body: <p>I have put together a code which checks whether the string begins with Q1, Q2, Q3 or Q4, and if found it should display the start of that quarter.</p>
  <pre><code>
  CREATE TABLE #Test (
    name VARCHAR (20) NOT NULL,
  );
  
  INSERT INTO #Test
      (name) 
  VALUES 
      ('Q324'),
      ('Q224')
  
  SELECT 
      name 
      ,[Year] = '20' + RIGHT(name,2)
      ,[Quarter] = CASE 
                      WHEN LEFT(name,2) = 'Q1' THEN '01'
                      WHEN LEFT(name,2) = 'Q2' THEN '04'
                      WHEN LEFT(name,2) = 'Q3' THEN '07'
                      WHEN LEFT(name,2) = 'Q4' THEN '10'
                      ELSE NULL
                  END
  from #Test
  </code></pre>
  <p><strong>Output table:</strong></p>
  <p><a href="https://i.stack.imgur.com/R7LAH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/R7LAH.png" alt="enter image description here" /></a></p>
  <p>How do I now go about displaying all the months within those quarters?</p>
  <p><strong>Expected Output:</strong></p>
  <pre><code>Name  Year   Quarter  MonthYear
  Q324  2024     03      Jul-24
  Q324  2024     03      Aug-24
  Q324  2024     03      Sep-24
  </code></pre>