• Joe Celko just this month published a solution for inventory which could be adapted to Payment allocations.

    See http://www.dbazine.com/ofinterest/oi-articles/celko32

    SQL = Scarcely Qualifies as a Language