title: coalesce and a case statement - explanation?
body: <p>I'm working on a query that doesn't seem to be doing what it's supposed to since being transferred from one SSRS server to another, and the following line in part of the where statement <em>appears</em> to be where the difference is, or at least from what I can find.</p>
  
  <pre><code>where COALESCE(field, -1) = CASE field WHEN 1 THEN 0 ELSE -1 END
  </code></pre>
  
  <p>I know it's probably a bit generic but can anyone shed any light on what this may be doing? I've read up on coalesce and gather that it finds the first non-null value from the specified list of fields, but I don't understand what the '-1' does there.</p>
  
  <p>I hope it's not too general a question and that someone can give me a clue as to what it may be doing</p>