title: IF, ELIF, ELSE in T-SQL
body: <p>I am working in SQL Server 2008 and trying to use a <code>IF, ELIF, ELSE</code> statement in the <code>SELECT</code> section of my code. What I want to do is the following:</p>
  
  <pre><code>IF BO.VALUE &lt; BO.REFERENCELOWERLIMIT
      THEN (BO.VALUE - BO.REFERENCELOWERLIMIT) #I WANT THIS TO BE NEGATIVE
  ELSE IF BO.REFERENCELOWERLIMIT &lt;= BO.VALUE &lt;= BO.REFERENCEUPPERLIMIT
      THEN BO.VALUE
  ELSE
      (BO.REFERENCEUPPERLIMIT - BO.VALUE)
  </code></pre>
  
  <p>The problem is that I do not understand how to do a IF, ELIF, ELSE type transaction in SQL. I have tried to search for this type of example and came across python examples...wrong language so I did a search on the MSDBN site and did not see this sort of work, just IF/ELSE.</p>
  
  <p>Thank You</p>