title: Using CASE Function with DATEDIFF and COUNT
body: <p>Hi I'm sure this is a simple fix but I cannot figure it out. I'm trying to label records that are overdue the completion date (CompleteDate-CurrentDate) (these numbers will be negatives) to "Overdue" for a report. I would also like the records to not be altered for the numbers that are not negatives.  Here is a snippet of the code which is currently giving me NULL entries</p>
  
  <pre><code>Select    CASE DATEDIFF(targetcompletedate, NOW()) 
          When count(*) &lt;=0 then 'Overdue'
      END 'Days Left',
  </code></pre>
  
  <p>Any help would be greatly appreciated
  Thanks</p>