• jcelko212 32090 - Monday, March 5, 2018 6:34 PM

    You also don’t know that there’s only one standard display format allowed in ANSI/ISO standard SQL. So first thing let’s go ahead and correct what you did post:

    Apparently, you've never actually read the standards, which allow for two formats. YYYYMMDD as the primary/preferred format and YYYY-MM-DD as a secondary format, which silently screws you in SQL Server depending on the default language.  For example, if the French language is the default, SQL Server will actually use or consume what you think is YYYY-MM-DD as YYYY-DD-MM and will only report an error if you violate the allowed range for any of the parts.

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