Date Picker minus weekends and holidays - Infopath 2007 - InfoPath Dev
in

InfoPath Dev

Date Picker minus weekends and holidays - Infopath 2007

Last post 02-03-2009 07:32 AM by mrdesignit. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 02-03-2009 07:32 AM

    Date Picker minus weekends and holidays - Infopath 2007

    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.

Page 1 of 1 (1 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.