title: SQL Case Statement not working with 'Else'
body: <p>The following Case statements do not work correctly - producing all results as 'i' (the 'Else' part of the statement).
  If I comment out the <em>Else</em> parts the code works ok, producing NULLs where the criteria isn't met.
  Any ideas why this is happening? Is ELSE not supported? I'm sure I've seen Else used in Case statements (but never with <em>And</em>)?</p>
  
  <pre><code>SELECT 
          EN,
          (First_Name + ' ' + Last_Name) as Name,
  
          First_Aid =MAX(CASE
              WHEN Course = 'First Aid' 
              and Status = 'Finished'
              and Course_Start_Date &gt; DATEADD(day, -1095, GETDATE())
              THEN 'F'
              ELSE 'i'
              END),
  
          Manual_Handling =MAX(CASE
              WHEN Course = 'Manual Handling' 
              and Status = 'Finished'
              and Course_Start_Date &gt; DATEADD(day, -1095, GETDATE())
              THEN 'F'
              ELSE 'i'
              END),
  
          Fire_Safety =MAX(CASE
              WHEN Course = 'Fire Safety' 
              and Status = 'Finished'
              and Course_Start_Date &gt; DATEADD(day, -1095, GETDATE())
              THEN 'F'
              ELSE 'i'
              END)
  into MyTraining
  FROM Learning_History
  
  Group By EN,First_Name, Last_Name
  </code></pre>