title: SSRS multi-value parameter using a stored procedure
body: <p>I am working on a SSRS report that uses a stored procedure containing a few parameters. I am having problems with two of the parameters because I want to have the option of selecting more than one item. </p>
  
  <p>Here's a condensed version of what I have:</p>
  
  <pre class="lang-sql prettyprint-override"><code>CREATE PROCEDURE [dbo].[uspMyStoredProcedure] 
    (@ReportProductSalesGroupID AS VARCHAR(MAX) 
    ,@ReportProductFamilyID AS VARCHAR(MAX)
    ,@ReportStartDate AS DATETIME
    ,@ReportEndDate AS DATETIME)
  
  --THE REST OF MY QUERY HERE WHICH PULLS ALL OF THE NEEDED COLUMNS
  
  WHERE DateInvoicedID BETWEEN @ReportStartDate AND @ReportEndDate
  AND ProductSalesGroupID IN (@ReportProductSalesGroupID)
  AND ProductFamilyID IN (@ReportProductFamilyID)
  </code></pre>
  
  <p>When I try to just run the stored procedure I only return values if I enter only 1 value for <code>@ReportProductSalesGroupID</code> and 1 value <code>@ReportProductFamilyID</code>.  If I try to enter two <code>SalesGroupID</code> and/or 2 <code>ProductFamilyID</code> it doesn't error, but I return nothing.</p>
  
  <pre class="lang-sql prettyprint-override"><code>-- Returns data
  EXEC uspMyStoredProcedure 'G23',     'NOF',     '7/1/2009', '7/31/2009'
  
  -- Doesn't return data
  EXEC uspMyStoredProcedure 'G23,G22', 'NOF,ALT', '7/1/2009', '7/31/2009'
  </code></pre>
  
  <p>In SSRS I get an error that says:</p>
  
  <blockquote>
    <p>Incorrect syntax near ','</p>
  </blockquote>
  
  <p>It appears that the <code>,</code> separator is being included in the string instead of a delimiter</p>