• ps_vbdev (5/26/2015)


    many thanks guys ISOWEEK was spot on, never knew about that.

    Thanks for the feedback. Just remember that some years have 52 weeks and some have 53. It's the nature of the year being 52.17 weeks long on average. For comparing the last week of each year, you might want to consider using the maximum week of the year.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)