Mega Code Archive

 
Categories / MSSQL Tutorial / Date Functions
 

SELECT DATEPART(weekday, CAST(20051004 AS DATETIME) + @@DATEFIRST)

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