title: Creating a complex case statement in sql stored procedure
body: <p>I am trying to convert an if statement into a SQL case statement and not having much luck getting the logic to work correctly. (My question is an updated version of <a href="https://stackoverflow.com/q/20125773/72324">SQL case statement in a stored procedure</a></p>
  
  <pre><code>if LossStatusCode == 'R' Then 'Item has been reviewed.'  
  
  ELseif //if  LossStatusCode != 'R'
      DateOfLoss &lt; PolicyStartDate THEN 'Invalid Date'  
      MilesDriven &gt; TotalMilesAllowed THEN 'Mileage exceeded'
  
  Else // if (LossStatusCode != 'R') &amp;&amp; Date is valid &amp;&amp; Mileage is Valid)
      LossStatusCode != 'R' Then 'Status code is Review.'
  </code></pre>
  
  <p>How would I convert the above logic into a SQL Case statement? </p>