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