title: CASE statement not updating Temp Table
body: <p>In the <code>UPDATE</code> statement below, the <code>InspectionChg</code>, <code>MileageChg</code>, <code>FuelChg</code> and <code>FreightChg</code> columns are not updating to temp table. Goal is to aggregate charges. I have tried several variations and I cannot get Temp Table Columns to update.</p>
  
  <pre><code> UPDATE #TTable   
         SET ChargeCode    = id.cht_itemcode,
          InspectionChg = CASE WHEN LEFT(id.cht_itemcode, 3) = 'INS'  THEN 
          InspectionChg+id.ivd_charge ELSE InspectionChg+0 END,
          MileageChg    = CASE WHEN LEFT(id.cht_itemcode, 4) = 'MILE' THEN MileageChg+id.ivd_charge 
          ELSE MileageChg+0 END,
          FuelChg              = CASE WHEN LEFT(id.cht_itemcode, 4) = 'FUEL' THEN 
          FuelChg+id.ivd_charge ELSE FuelChg+0      END,
          FreightChg    = CASE WHEN LEFT(id.cht_itemcode, 2) = 'LH'   THEN FreightChg+id.ivd_charge 
          ELSE FreightChg+0 END,
           Rate = 1
    FROM #TTable
    INNER JOIN invoicedetail as id
       on #TTable.OrderNumber = id.Ord_hdrnumber 
  </code></pre>
  
  <p>What is wrong?</p>