Date Functions MSSQL Tutorial

6>  SELECT DATEPART(weekday, CAST('20051004' AS DATETIME) + @@DATEFIRST);
7> GO
-----------
          3
-----------
          3
1>