title: cannot read the next data row for the dataset
body: <p>I have a query that is working in sql management studio, but when I run this is SSRS/Visual Studio I get the error "cannot read the next data row for the dataset dataset1. Error converting data type nvarchar to numeric"</p>
  
  <pre><code>select
  
      concat(
      right(replace(oe_hdr.po_no, '-', ''),8),
      right(concat('000',job_price_line.line_no),3),
      format(oe_pick_ticket_detail.unit_quantity, '00000000'),
      cast(job_price_line.customer_part_no as char(20)),
      oe_pick_ticket.invoice_no)  as [po/line/release/qty/cust part no as 20 characters / invoice]
  
  
  
  
      from oe_pick_ticket
  
  join oe_pick_ticket_detail on oe_pick_ticket_detail.pick_ticket_no = oe_pick_ticket.pick_ticket_no 
  join oe_hdr on oe_hdr.order_no = oe_pick_ticket.order_no
  join job_price_hdr on oe_hdr.job_price_hdr_uid = job_price_hdr.job_price_hdr_uid
  join job_price_line on job_price_line.inv_mast_uid = oe_pick_ticket_detail.inv_mast_uid and job_price_line.job_price_hdr_uid = oe_hdr.job_price_hdr_uid 
  join ship_to on ship_to.ship_to_id = oe_hdr.address_id
  join branch on branch.branch_id = ship_to.default_branch
  join customer on customer.customer_id = oe_hdr.customer_id
  
  where oe_pick_ticket.invoice_no in ('1218972', '1218983')
  and job_price_line.row_status_flag != '705'
  and oe_pick_ticket_detail.ship_quantity &gt; '0'
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/8JiZT.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8JiZT.jpg" alt="enter image description here"></a></p>
  
  <p>But when I run this for SSRS - and I add more parameters to my where clause like this:</p>
  
  <pre><code>    where oe_pick_ticket.invoice_no in (@invoiceno1, @invoiceno2, @invoiceno3,
       @invoiceno4, @invoiceno5, @invoiceno6, @invoiceno7 ,@invoiceno8,
   @invoiceno9, @invoiceno10, @invoiceno11, @invoiceno12, @invoiceno13,
   @invoiceno14, @invoiceno15, @invoiceno16, @invoiceno17, @invoiceno18,
   @invoiceno19, @invoiceno20)
          and job_price_line.row_status_flag != '705'
          and oe_pick_ticket_detail.ship_quantity &gt; '0'
  </code></pre>
  
  <p>It returns the error</p>
  
  <p><a href="https://i.stack.imgur.com/PvR84.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PvR84.jpg" alt="enter image description here"></a></p>