day of week in sql code example Example 1: datepart day of week SELECT DATENAME(DW,'2007-10-30'); Example 2: extract weekday from date in sql SELECT WEEKDAY(date);