Как получить будний день со старой даты в SQL
select format(columnName, 'dddd') as WeekDay from tableName; -- SQL Server 17
Excited Eagle
select format(columnName, 'dddd') as WeekDay from tableName; -- SQL Server 17
SELECT WEEKDAY(date);
SELECT TO_CHAR(your_table.date_colunm, 'DAY')
FROM your_table;
SELECT
DATEADD(DAY, 2 - DATEPART(WEEKDAY, GETDATE()), CAST(GETDATE() AS DATE)) [Week_Start_Date],
DATEADD(DAY, 8 - DATEPART(WEEKDAY, GETDATE()), CAST(GETDATE() AS DATE)) [Week_End_Date]