title: Case in where Clause to find String in Parameter
body: <p>I have a table in my database tblCustomer, which has 8 boolean fields (MS01,MS02... MS08)
  Using an SSRS report, I have a multi value parameter dropdown list that allows the selection of each of the 10 values
  So if I select MS01 &amp; MS05 from the list, the parameter @idSite will equal 'MS01','MS05'</p>
  
  <p>'-1' = True</p>
  
  <p>I want to select all records from tblCustomer where the selected parameter values are true</p>
  
  <pre><code>select idCustomer, MS01, MS02,MS03, MS04,MS05,MS06,MS07,MS08 from tblCustomer
  
  WHERE     (tblCustomer.CustomerYN = '-1')
  AND
  CASE 
  WHEN  @idSite like '%MS01%' THEN  tblCustomer.MS01=-1 
  WHEN  @idSite like '%MS02%' THEN  tblCustomer.MS02=-1
  WHEN  @idSite like '%MS03%' THEN  tblCustomer.MS03=-1
  END as MailShot
  </code></pre>
  
  <p>I also tried using when the string was 'in' the pareameter</p>
  
  <pre><code>select idCustomer, MS01, MS02,MS03, MS04,MS05,MS06,MS07,MS08 from 
  tblCustomer
  
  WHERE     (tblCustomer.CustomerYN = '-1')
  AND
  CASE 
  WHEN  'MS01' in @idSite THEN  tblCustomer.MS01=-1 
  WHEN  'MS02' in @idSite THEN  tblCustomer.MS02=-1
  
  END as MailShot
  </code></pre>
  
  <p>I thought I was close with the above, but no joy. Can anyone point me in the right direction?</p>
  
  <p>EDIT</p>
  
  <p>@idSite is SSRS multi value parameter dropdown list. 
  It takes value idMailshot from the below table based on the section from the drop down </p>
  
  <pre><code>idMailShot  Location
  MS01    Location1   
  MS02    Location2     
  MS03    Location3 
  MS04    Location4  
  MS05    Location5  
  MS06    Location6     
  MS07    Location7   
  MS08    Location8   
  MS09    Location9
  </code></pre>
  
  <p>So If i select Location1 &amp; Location 2 from the drop down, "MS01,MS02" should be passed as @idSite
  I want to </p>
  
  <pre><code>select idCustomer from tblCustomer where
  tblCustomer.MS01 =-1 AND tblCustomer.MS02=-1
  </code></pre>