title: Excluding records if it's a certain type in a running sum
body: <p>Table like this:</p>
  
  <pre><code>Description Type    Amount
  Record      1       10
  Record      2       20
  Record      1       5
  Record      3       10
  </code></pre>
  
  <p>How do I exclude records of a certain type in my running sum?  So if I exclude Type 3, my running sum becomes:</p>
  
  <pre><code>Description Type    Amount  RunningSum
  Record      1       10      10
  Record      2       20      30
  Record      1       5       35
  </code></pre>
  
  <p>I'm using the update local variable technique.  What I have:</p>
  
  <pre><code>DECLARE @Amount DECIMAL(18, 4)
  
  SET @Amount = 0
  
  UPDATE MY_TABLE
  SET RunningTotal = @Amount
      ,@Amount = @Amount + ISNULL(Amount, 0)
  </code></pre>