title: How to use alias column name in where clause in SQL Server
body: <p>When I tried to perform the below code in SQL Server 2005 I am getting the error </p>
  
  <blockquote>
    <p>Invalid column name DistanceFromAddress</p>
  </blockquote>
  
  <p>Code:</p>
  
  <pre><code>select 
      SQRT(POWER(cast(Program_Latitude as float) - cast('41.5126237' as float), 2) +   
      POWER(cast(Program_Longitude as float) - cast('-81.6516411' as float), 2)) * 62.1371192 AS DistanceFromAddress 
  from 
      tblProgram 
  where 
      DistanceFromAddress &lt; 2
  </code></pre>
  
  <p>I am getting the values correctly using the select statement,but when i tried to check the condition <code>where DistanceFromAddress &lt; 2</code> I am getting the error.</p>
  
  <p>How can I solve this issue?</p>