title: SQL: Turn an IN to an AND instead of OR
body: <p>Code in question: </p>
  
  <pre><code>...and crset.Name IN (Select [part] from [dbo].[SplitString](@Type, ',')...
  </code></pre>
  
  <p>Assume <code>@Type</code> is <code>'Blue,White'</code> and the splitstring function allows me to turn that string into a list for using IN.</p>
  
  <p>Currently this returns all entries that have blue or white, let's say house color. What I want is a way to say "Only those houses whose colors are in the list and must have ALL of the colors in the list. This would mean that there are multiple entries for each house: one entry for each color that it has (which is the case in the db). That means that houses that have entries for "Red" and "White" would not show up, entries for only "Blue" would not show up, entries for "white" would not show up but any house which has multiple records (blue, white) would.</p>
  
  <p>Let me know if you need more code to work from.</p>