Given a date of say 15/5/2006 13:00 and then given a time span of say 1 day, how do i then halve that date?
**There is a few catches**
1) Must take into consideration weekends
2) Must take into consideration working hours
As an example, today is the 5th June, if i have a time span of 1 day.
Add one day to 5th June 13:30 = 6th June 13:30
Halve one day (which is based on a 9-5 day, so 4 hours) = 6th June 09:30
So, if was 6th June at 10:00 and you halved a day and subtracted it, taking into consideration working days it would work out to be the day before because it would be before 9am. Same applies to weekends.
How do i do this with SQL?????