Hi all
I'm trying to calculate the number of days (or workdays) between 2 given
dates that do not include weekend days or public holidays
(public holidays are user defined from a dbase, have a start date & an end
date & may span a weekend)
If a start date (workday) & an end date (workday) are on the same day then
the number of workdays will equal zero
Some eg's.
Start Date - 2-Dec-04 (Thurs)
End date 2-Dec-04 (Thurs)
No of working days = 0
Start Date - 2-Dec-04 (Thurs)
End date 3-Dec-04 (Fri)
No of working days = 1
Start Date - 2-Dec-04 (Thurs)
End date - 10-Dec-04 (Fri)
No of working days = 6 (8 total days minus 2 weekend days)
Start Date - 2-Dec-04 (Thurs)
End date - 22-Dec-04 (Wed)
Public Holiday Start Date - 17-Dec-04 (Fri)
Public Holiday End Date - 20-Dec-04 (Mon)
No of working days = 12 (20 total days minus 6 weekend days minus only 2 of
the Public Holiday days as 2 fell on a weekend)
Start Date - 2-Dec-04 (Thurs)
End date - 17-Dec-04 (Fri)
Public Holiday Start Date - 17-Dec-04 (Fri)
Public Holiday End Date - 20-Dec-04 (Mon)
No of working days = 10 (15 total days minus 4 weekend days minus only 1 of
the Public Holiday days as the End date fell on the 1st day of the Public
Holday)
I've been experimenting with timespans & datediff but just can't seem to get
it off the ground
Has anyone done something similar or could point me in the right direction ?
Regards
Wayne