I want to add a number of normal working days to a date
taking account of weekends and holidays.
For example, I want to add 2 days to the following date,
but to exclude the weekend:
Friday 4th October. - the result should be Tuesday 8th
October
I have table of holidays, I want the calculation to take
account of any holidays as well. Using the same example as
above:
If Monday 7th October was a holiday then the date returned
should be Wednesday 9th October
If Tuesday 8th October was a holiday (but Monday isn't)
then the date returned should be Thursday 10th October
A further twist to this problem is that I want to take
account of normal working hours as well. For example, I
may want to add 2 normal working hours to my date. If a
normal working day is 08:00 to 17:00 and Monday 7th
October is a holiday, then adding 2 hours to Friday 4th
October at 16:00 should return Tuesday 8th October 09:00
How can this calculation be expressed in SQL?
I would appreciate any assistance
Justin