TSQL Challenge 65 - Solving the Running Total Problem
This challenge invites you to solve one of the most common calculation challenges seen in applications that deal with financial transactions.
http://beyondrelational.com/puzzles/challenges/99/solving-the-running-total-problem.aspx