WorkingDays ( )

Function stats

Average user rating
38
261
9999
Support
FileMaker 9.0 +
Date posted
10 July 2010
Last updated
30 July 2010
Version
Recursive function
Yes

Author Info
 Daniele Raybaudi

8 functions

Average Rating 5.0

author_avatar



 

Function overview

Prototype

WorkingDays  ( DateStart;   DateEnd;   HolidayList )


Parameters

DateStart  


DateEnd  


HolidayList  


Description

Tags:  Date  

Returns the number of working days between the two dates w/o weekends and holidays.

All you need to do is create the holiday list.

Examples

Sample input

WorkingDays ( "07/07/2010" ; "07/07/2010" ; YourList )


Sample output

1

 

Function code

/*
WorkingDays ( DateStart ; DateEnd ; HolidayList )

returns the number of working days between the two dates.
No weekend days nor any day of the HolidayList
*/

Let (
$counter = $counter + ( Mod ( DateStart - 1 ; 7 ) < 5 and IsEmpty ( FilterValues ( DateStart ; HolidayList ) ) );
Case(
DateStart > DateEnd ; "" ;
DateStart = DateEnd ; $counter & Let( $counter = "" ; "" );
WorkingDays ( DateStart + 1 ; DateEnd ; HolidayList )
)
)

// ===================================
/*

    This function is published on FileMaker Custom Functions
    to check for updates and provide feedback and bug reports
    please visit http://www.fmfunctions.com/fid/261

    Prototype: WorkingDays( DateStart; DateEnd; HolidayList )
    Function Author: Daniele Raybaudi (http://www.fmfunctions.com/mid/38)
    Last updated: 30 July 2010
    Version: 1.1

*/
// ===================================

 

 

 

 


Login or register to comment

Create a new account with fmcustomfunctions.com or login to post a comment.

 

 

 

Top Tags

Text Parsing  (24)
List  (20)
XML  (15)
Date  (14)
Format  (14)
Debug  (12)
Layout  (11)
Variables  (10)
Filter  (9)
Interface  (8)
Layout Objects  (6)
ValueIterator  (6)
Recursive  (6)
Dev  (5)
Text  (5)
Number  (5)