Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
I have a sp where user can pass in parameter like @DaysBack. I use this parameter to calulate how many days this is back from current day like:
declare @DateFrom_yyyy_mm_dd as char(12)set @DateFrom_yyyy_mm_dd = cast(convert(varchar(8), current_timestamp - @DaysBack, 112) as datetime)
I use this date as starting date for adding up sales quantities by the hour for every day up to current and excluding current day. I am excluding SaturDay and Sunday. I am not worried about holidays at this point. The @DaysBack parameter can dynamically bet set by user.Is there a way to find out how many days are included in the selection excluding any Saturday or Sunday Thank you.