i have the SQL code to generate the date list between two dates, but i want to generate the week days (Business days) from the given two dates,
DECLARE @MinDate DATE = '20140101', @MaxDate DATE = '20140106';
SELECT TOP (DATEDIFF(DAY, @MinDate, @MaxDate) + 1)
Date = DATEADD(DAY, ROW_NUMBER() OVER(ORDER BY a.object_id) - 1,@MinDate)
FROM sys.all_objects a
CROSS JOIN sys.all_objects b;
This is my code, so anyone please suggest me to get the weekdays list alone. Online sources have code to find the number of days not for to list all dates, there lies my confusion.