title: CASE statement IF ELSE in SQL Server
body: <p>I have this <code>select</code> statement and what I am trying to accomplish is to get data in the<br>
  <code>DosagePerUnits</code> column only if <code>Dosage</code> is not equal to empty or 1 and if <code>Units</code> is not empty or 1. </p>
  
  <p>Can someone help me please ?</p>
  
  <pre><code>select 
      sbd.Code, c.Description, sbd.Dosage, 
      Case 
          when sbd.Units = '' then '1' 
          else sbd.Units 
      end as Units, 
      ad.ApptDate, sbd.RCycle, sbd.RWeek, sbd.RDay, 
      t.HistoryOrder, t.TypeId, sbd.Dosage + '/' + sbd.UnitsAS DosagePerUnits
  from
      bill_SuperBillDetail sbd, 
      bill_ProcedureVerification pv, 
      AppointmentData ad,
      CPTCode c, 
      CPTType t
  where 
      sbd.AccessionNumber = pv.AccessionNumber
      and pv.ApptId = ad.ApptId
      and ad.PatientId = 443
      and ad.ApptDate &lt;= GETDATE()
      and ad.ApptDate &gt; '2009-11-15 00:00:00.000'
      and c.TypeId = t.TypeId
  </code></pre>