title: Invalid column name error when adding to Group By
body: <p>I have this in my Select statement and need to add to my GROUP BY</p>
  
  <pre><code>,cast(year(getdate()) as nvarchar(4))+cast(DATEPART(QUARTER,getdate()) as nvarchar(1))+'Q' mQuarter
  </code></pre>
  
  <p>When I add the column mQuarter to the Group by I get an error:</p>
  
  <blockquote>
    <p>Msg 207, Level 16, State 1, Line 27<br>
    Invalid column name 'mQuarter'</p>
  </blockquote>