• Cool.  Looks like there are a lot of ways to solve this puzzle. 

    Aunt Kathi Data Platform MVP
    Author of Expert T-SQL Window Functions
    Simple-Talk Editor