title: sum with multiple condition in sql server
body: <p>I have a query that captures the sum with multiple condition (see below), however, i would like to do the same thing but within a case statement if possible.</p>
  
  <p><em>Original Query:</em></p>
  
  <pre><code>select
  sum(Total Cost)
  from Table 
  where date between '7/20/2016' and '7/21/2016'
  and customer = "New Customer"
  and sales like 's%'
  </code></pre>
  
  <p>I'm trying to put that in one case statement.</p>
  
  <pre><code>select
  sum(case when total cost is not null then 1 else
      case when customer = 'New Customer' then 1 else
      case when sales like 's%' then 1 else
      end end end
  from table
  where date between '7/20/2016' and '7/21/2016'
  </code></pre>
  
  <p>Thanks for the help</p>