title: Using CASE with IN rather than =
body: <p>I want to do something like the following but I can't find good way to make it happen. The following:</p>
  
  <pre><code>where i.expirationdate in 
      case when i.locationstate = 'ca' then 
          case when datepart(month, @RunDate) &lt; 3 then 
                 (dateadd(day, 60, @RunDate))
               when datepart(month, @RunDate) = 3 then 
                 (dateadd(day, 60, @RunDate), dateadd(day, 90, @RunDate))
               else 
                 (dateadd(day, 90, @RunDate))
          end
      else 
             (dateadd(day, 45, @RunDate))
      end
  </code></pre>
  
  <p>throws an error: </p>
  
  <blockquote>
    <p>Incorrect syntax near the keyword 'case'</p>
  </blockquote>
  
  <p>It works with <code>=</code> but I lose the benefits of <code>in</code>, obviously. Is it not possible to do this?</p>