title: SQL Server: Error converting data type varchar to float
body: <p>I have the following <code>SELECT</code> statement to calculate <code>RADIANS</code> and <code>COS</code>. </p>
  
  <pre><code>SELECT COS(RADIANS(latitude)) as Lat 
  FROM tbl_geometry;
  </code></pre>
  
  <p>But I'm getting an error:</p>
  
  <blockquote>
    <p>Error converting data type varchar to float.</p>
  </blockquote>
  
  <p>My attempts:</p>
  
  <p><strong>Attempt #1</strong>:</p>
  
  <pre><code>select Cos(convert(float, (Radians(convert(float, latitude))))) as Lat 
  from tbl_geometry;
  </code></pre>
  
  <p><strong>Attempt #2</strong>.</p>
  
  <pre><code>select Cos(Radians(convert(float, latitude))) as Lat 
  from tbl_geometry;
  </code></pre>
  
  <p>Both attempts result in the same error.</p>
  
  <p><strong>Note</strong>: column <code>Latitude</code> is of type <code>varchar</code>.</p>