|
declare @date datetime = '2011/09/25',@days = 2 suppose in between those todays if any saturday and sunday comes in then it should return the previous dates. suppose if we pass @days as 1, then it should check if the previous day is a saturday or sunday, if it is saturday or sunday then previous day should return
(comments are locked)
|
|
Hi, Please try this code and let me know if you have any concerns regarding the code.
(comments are locked)
|


What if @days = 10? Should it remove only workdays or should it remove 10 days and then another 1 or 2 if the result is saturday or sunday? If original day is Wednesday September 14th, what should be the result if @days=10? Wednesday September 1st or Friday September 3rd?