sql 2019 get day of week code example Example: datepart day of week SELECT DATENAME(DW,'2007-10-30');