Sql add days to a date taking into account the weekend
Hi,
I'm trying to calculate a due date for an order based on a set lead days parameter.
Ideally 'd like to do this in a function.
I have an order creation date.
From that I want to add 5 working days to it.
However, if part or all of the weekend fall within the 5 days I want to be able to take that into account
So an order placed on Thursday would be due the follwing Thursday.
i.e 5 working days plus 2 non working days.
http://stackoverflow.com/questions/252519/count-work-days-between-two-dates-in-t-sql