• SwePeso (7/26/2013)


    Any January 1st will do, as long as it is a monday in a non-leapyear.

    I am running on SQL Server 2012 and have tested every January 1st between 0001 and 1900. Only some of them work, and the common denominator is that the working ones are non-leapyears.

    In the above, you tested the new formula or the old? Like I said, the old one was totally screwed for any date prior to 1900-01-01 and any semblance of actually working was purely accidental.

    I got notice this morning that they took the article down as I requested. I'll have them put it back up after I make some changes.

    Thanks again for finding the shortcoming, Peter. I appreciate it.

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