Brian Dunning's FileMaker Custom Functions

AddWorkDays ( startdate ; workdays ; daystoadd )

Add workdays or schedule-days to a certain startdate

  Be the first to rate this function Log in to vote

Menno van Beek   Menno van Beek - Show more from this author
Van Beek Zakelijke Software
https://www.vbzs.nl

Share on Facebook Share on Twitter

  Sample input:
AddWorkDays ( Date ( 1 ; 4 ; 2022 ) ; "0111110" ; 5 )
  Sample output:
01/11/2022

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Add workdays to a date by skipping non-work days. The workdays of a week can be set in the second parameter or left empty, an illegal entry will cause the function not to calculate a new date.

So a few examples:
AddWorkDays ( Date ( 1 ; 4 ; 2022 ) ; "0111110" ; 5 ) = 01/11/2022 /* Workdays: mo-fr */
AddWorkDays ( Date ( 1 ; 4 ; 2022 ) ; "0111100" ; 5 ) = 01/12/2022 /* Workdays: mo-th */
Faulty input:
AddWorkDays ( Date ( 1 ; 4 ; 2022 ) ; "01100" ; 5 ) = 01/04/2022 .... No days are added, because string of workdays is incorrect.

 

Comments

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: