Friday 3 June 2011

DATEPART considerations

Just a quick not on Using the DATEPART(WEEKDAY, value) function in SQL server.

My sql server is set up to use Sunday as the first day of the week which res returning the wrong day for my DATEPART queries.

To set the first day of the week to Monday you can use:


To set the first day of the week to Sunday you can use:


To check what DATEFIRST is currently set to you can use:

No comments:

Post a Comment