title: Error converting data type varchar to numeric -joining tables
body: <p>I am not able to join two columns with different data types.</p>
  
  <p><code>main_ref_id</code> is <code>char</code> and <code>person_id</code> are <code>numeric</code></p>
  
  <p>Query:</p>
  
  <pre><code> select 
       main_ref_id 
   from 
       not 
   where 
       main_ref_type = 'P' 
       and convert(numeric(9, 0), main_ref_id) in (select cast(person_id as numeric) 
                                                   from person_wo_memberships)
  </code></pre>
  
  <p>Error</p>
  
  <blockquote>
    <p>Msg 8114, Level 16, State 5, Line 1<br>
    Error converting data type varchar to numeric.</p>
  </blockquote>
  
  <p>Any help???</p>