Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.
DECLARE @start DATETIME, @end DATETIME SET @start = @startday SET @end =@enddate /*this query is independent from localized day names and datestart setting*/ SELECT /*days between the two dates*/ DATEDIFF(DD, @start, @end) + 1 - /*full weeks between sunday immediately following @start and last monday before @end*/ (DATEDIFF(DD, DATEADD(DD, 6 - ((DATEPART(DW, @start) + @@DATEFIRST - 2) % 7), @start), DATEADD(DD, - ((DATEPART(DW, @end) + @@DATEFIRST - 2) % 7), @end)) - 1) / 7 * 2 - /*remove first weekend, if any*/ CASE (DATEPART(DW, @start) + @@DATEFIRST - 2) % 7 + 1 WHEN 6 THEN 1 WHEN 7 THEN 0 ELSE 2 END - /*remove last weekend, if any*/ CASE (DATEPART(DW, @end) + @@DATEFIRST - 2) % 7 + 1 WHEN 6 THEN 1 WHEN 7 THEN 2 ELSE 0 END AS WorkingDays
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.