• Rich Mechaber (9/28/2016)


    Steve, in your explanation, did you mean to say "This is offset by -1" instead of "by 1"? Or maybe by "offset" you meant the successive values of the ROWNUMBER() generated values in the CTE and not the N-1 argument of DATEADD?

    I also was looking for the gotcha!

    Rich

    Fair enough. The offset is by 1, but in the negative direction, but I can see why you might confuse that.

    Changed.