• Jeff Moden (9/26/2013)


    Michael Valentine Jones (9/25/2013)


    That's not really the best way to go because it depends on the setting of a run-time session parameter, DATEFIRST.

    Although I certainly prefer you method, I have to ask... why does everyone have such a problem with that? It's no different than setting a variable that would be used as a constant. The only time that such a setting change would be a problem is if it were in a function, which can't be done TTBOMK.

    I wanted the OP to be aware of the limitations of their method. They are certainly free to ignore my wonderful advice. 😎

    I prefer to have code that works as expected under the widest possible conditions, especially if it's no harder to code.

    People may be operating with different default languages than our "normal" US English, and that can change the setting of DATEFIRST, and the client application can also define that setting in an unexpected way.