Brian Dunning's FileMaker Custom Functions

FirstDayThisWeek ( StartDay )

Date of first day of current week

  Average rating: 4.0 (40 votes) Log in to vote

Matt Wills   Matt Wills
Virtual Vermont
http://www.virtualvermont.com/FMP/

Share on Facebook Share on Twitter

  Sample input:
FirstDayThisWeek (1)

FirstDayThisWeek (2)
  Sample output:
Date of Sunday of this week

Date of Monday of this week

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

Returns the date of the first day of the current measurement week (work week?). StartDay can be hardcoded in the function or derived from a global field as might be used to set a preference.

 

Comments

Phil McGeehan   Phil McGeehan, Poole, UK
Oct 27, 2016
I had issues if the date was a Sunday, it would calculate the first date this week as the next Monday, not the one at the beginning of the week.

This calculation met my needs much more accurately:
Div ( date - 1 ; 7 ) * 7 + 1
 

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.