Thursday, October 13, 2011

FileMaker TIP: Next Work Day

I needed a function to find the next work day (excluding weekends). I came up with a pretty simple function that I like to call "NextWorkDay" - it takes any date as the parameter (theDate). You can use this as a function, or as a calculation (just replace "theDate" below with the field name).


Let ( [ dow = DayOfWeek ( theDate ); daysToAdd = Case ( dow >= 6; 9 - dow; 1)] ;
Date ( Month ( theDate ); Day ( theDate ) + daysToAdd; Year ( theDate )) )


Pretty simple - but it works well...

No comments:

Web Analytics