title: how to convert the output of sub query into numeric
body: <pre><code>select rptName 
  from RptTable 
  where rpt_id in (
      select LEFT(Reports,    NULLIF(LEN(Reports)-1,-1))  
      from repoAccess1 
      where uid = 'VIKRAM'
  )
  </code></pre>
  
  <p>this is my sql query In which i have use the sub query to access selected field</p>
  
  <p>in this sub query returns </p>
  
  <pre><code>select LEFT(Reports,    NULLIF(LEN(Reports)-1,-1))  
  from repoAccess1 
  where uid = 'VIKRAM'
  </code></pre>
  
  <p>Returns
      1,2</p>
  
  <p>that means the query should be like </p>
  
  <pre><code>select rptName 
  from RptTable where rpt_id in (1,2)
  </code></pre>
  
  <p>But i m getting this error</p>
  
  <pre><code>Msg 8114, Level 16, State 5, Line 1
  Error converting data type nvarchar to numeric.
  </code></pre>
  
  <p>could anyone tell me ow to modify to get exact ans</p>