Using SQL Server's First Day of the Week Setting : DATEFIRST « Date Functions « SQL Server / T-SQL Tutorial






3>
4> SELECT @@DATEFIRST 'First Day of the Week'
5> GO
First Day of the Week
---------------------
                    7

(1 rows affected)








10.5.DATEFIRST
10.5.1.To change the first day value, you can use the SET DATEFIRST command.
10.5.2.Using SQL Server's First Day of the Week Setting
10.5.3.SELECT DATEPART(weekday, CAST('20051004' AS DATETIME) + @@DATEFIRST);