I have looked into several VB Scripts and have yet to discover what the code should look like if I would like to exclude the weekends and Holidays. The ones that I have seen don't seem to work or I am missing something. Below is the Expression I am using on the starting date;
(number(substring(@Ending_Date, 9, 2)) + floor((153 * (number(substring(@Ending_Date, 6, 2)) + 12 * (floor((14 - number(substring(@Ending_Date, 6, 2))) / 12)) - 3) + 2) / 5) + (number(substring(@Ending_Date, 1, 4)) + 4800 - (floor((14 - number(substring(@Ending_Date, 6, 2))) / 12))) * 365 + floor((number(substring(@Ending_Date, 1, 4)) + 4800 - (floor((14 - number(substring(@Ending_Date, 6, 2))) / 12))) / 4) - floor((number(substring(@Ending_Date, 1, 4)) + 4800 - (floor((14 - number(substring(@Ending_Date, 6, 2))) / 12))) / 100) + floor((number(substring(@Ending_Date, 1, 4)) + 4800 - (floor((14 - number(substring(@Ending_Date, 6, 2))) / 12))) / 400) - 32045) - (number(substring(., 9, 2)) + floor((153 * (number(substring(., 6, 2)) + 12 * (floor((14 - number(substring(., 6, 2))) / 12)) - 3) + 2) / 5) + (number(substring(., 1, 4)) + 4800 - (floor((14 - number(substring(., 6, 2))) / 12))) * 365 + floor((number(substring(., 1, 4)) + 4800 - (floor((14 - number(substring(., 6, 2))) / 12))) / 4) - floor((number(substring(., 1, 4)) + 4800 - (floor((14 - number(substring(., 6, 2))) / 12))) / 100) + floor((number(substring(., 1, 4)) + 4800 - (floor((14 - number(substring(., 6, 2))) / 12))) / 400) - 32045)
The problem is this code works along with another Date Picker "Ending Date" They cross check each other and then write the difference of the two in another Text Field. I need the users not allow the weekends. Also if I decide I need Monday - Friday off, the system shows this as 4 days off, assuming I'm returning on Friday. Is there a fix for that as well.