title: Arithmetic overflow error converting varchar to data type numeric?
body: <p>Just now I was getting this error when running a stored procedure:</p>
  
  <pre><code>Arithmetic overflow error converting varchar to data type numeric.
  </code></pre>
  
  <p>I located the line where that error was coming from and this is the code on that line:</p>
  
  <pre><code>SELECT @AF_MIN_3L = LEFT(MIN([A-F Est_CY]), 6) - 0.000001 FROM #Ent_AF_3
  </code></pre>
  
  <p>Earlier in the stored procedure, I declared @AF_MIN_3L as data type FLOAT, created the temp table #Ent_AF_3 and in doing so, made the column [A-F Est_CY] data type FLOAT. Is the following code creating a non-FLOAT value?</p>
  
  <pre><code>LEFT(MIN([A-F Est_CY]), 6) - 0.000001
  </code></pre>
  
  <p>I hope it's a simple casting issue and all I have to do is something like this:</p>
  
  <pre><code>LEFT(MIN(CAST([A-F Est_CY] AS FLOAT)), 6) - CAST(0.000001 AS FLOAT)
  </code></pre>
  
  <p>I didn't want to run the whole procedure again without being sure I fixed the issue. Thanks for any help.</p>