sql server datepart weekday code example
Example 1: how to get weekday from old date in sql
select format(columnName, 'dddd') as WeekDay from tableName; -- SQL Server 17
Example 2: datepart day of week
SELECT DATENAME(DW,'2007-10-30');
Example 3: sql server convert date to weekday
SELECT DATENAME( DW , GETDATE() );
Example 4: extract weekday from date in sql
SELECT WEEKDAY(date);