title: Getting 'Error converting data type varchar to numeric.'
body: <p>I have a table called <code>testTable</code> with two columns, <code>id</code> that is auto incremented and <code>someValue</code>.</p>
  
  <p>The data contained in the <code>someValue</code> column are: <code>12, 1.2, .4, 1d4, +, -, .</code></p>
  
  <p>Data type for <code>someValue</code> is <code>varchar(50)</code>.</p>
  
  <p>Why are the following queries throwing </p>
  
  <blockquote>
    <p><em>Error converting data type varchar to numeric.</em></p>
  </blockquote>
  
  <pre><code>select ID, someValue 
  from testTable 
  where ISNUMERIC(someValue + 'd0') = 1 and CAST(someValue as decimal(8,2)) &gt; 0.1;
  
  select tt.ID,tt.someValue 
  from (select ID, someValue 
        from testTable 
        where ISNUMERIC(someValue + 'd0') = 1) as tt 
  where CAST(tt.someValue as decimal(8,2)) &gt; 0.1;
  </code></pre>