• Understood. But, with the exception of the abbreviation for "microseconds", which would really have been cool as the more standard "us" instead of "mcs", I just don't have a problem with the abbreviations from Col1 below. Even "dy" and "dw" are easy for me because I think of "dw" as "Day of Week" rather than the mostly incorrect "WeekDay". Of course, I'd never use the abbreviations from Col2 because they have an inconsistent number of characters, which would mess with my formatting.

    Abbreviations

    DatePart Col1 Col2

    =========== ===== =====

    year yy yyyy

    quarter qq q

    month mm m

    dayofyear dy y

    day dd d

    week wk ww

    weekday dw

    hour hh

    minute mi n

    second ss s

    millisecond ms

    microsecond mcs

    nanosecond ns

    TZoffset tz

    ISO_WEEK isowk isoww

    I can, however, see a newbie incorrectly using "MM" instead of "MI" but, if a newbie is reading my code, that's a small issue compared to trying to figure out things like what a Tally CTE is doing. 😛 At the very least, the abbreviations inspire newbies to learning a bit more by looking it up in BOL (which, according to many of the questions posted on these fine forums, seems to be a bit of a lost art in itself).

    As a bit of a sidebar, I wish they had stuck to strictly 2 character abbreviations for Col1 because then ISOWK would have been the more appropriate "IW", which would be appropriately pronounced "ew!". 😛

    And, again, no... this isn't an argument as to what is right or wrong. I'm just explaining my personal choice.

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