• sharonsql2013 (7/29/2015)


    Came up with two separate queries one for last week and one for alternate weeks (%2) and did a Union. That helped

    None of it will work if you're closer to the beginning of the year than 31 weeks and you'll only get a partial week for the first week of the year 6 out of 7 years on a 100 year average.

    --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)