Brian Dunning's FileMaker Custom Functions

OneDayBack ( input )

find latest non weekend date before input date

  Average rating: 4.3 (28 votes) Log in to vote

Darrin Morton   Darrin Morton
Neocode Software
http://www.neocodesoftware.com

Share on Facebook Share on Twitter

  Sample input:
OneDayBack(29/07/2013)
  Sample output:
26/07/2013

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

Finds the most previous non-weekend date to input date. For example:

1. Given input date of Wed Jul 24, 2013 will return Tue Jul 23, 2013.

2. Given input date of Monday Jul 29, 2013 will return date of Fri Jul 26, 2013

 

Comments

Daniele Raybaudi   Daniele Raybaudi, ACI
Aug 2, 2013
You do not need $ variables and it's better to not use them in this case. Try:

Case (
DayOfWeek ( input ) = 2 ; date - 3 ;
DayOfWeek ( input ) = 1 ; date - 2 ;
date - 1
)
 
Darrin Morton   Darrin Morton, Victoria, BC
Aug 2, 2013
once again daniele is right, with a minor tweak, i have revised to correct, works great
 
Daniele Raybaudi   Daniele Raybaudi, ACI
Aug 3, 2013
Another formula, same result:

input - 1 - Choose ( DayOfWeek ( input ) - 1 ; 1 ; 2 )
 

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.

Under construction. Email me your wish list for improvements.