WeekOfMonth ( _date ; startingDay )
Returns a number between 1 and 6 representing the week containing date
Average rating: 4.2 (40 votes) Log in to vote
Daniele Raybaudi - Show more from this author
ACI http://www.aci.it |
WeekOfMonth ( "06/07/2009" ; 2 )
1
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
WeekOfMonth ( _date ; startingDay ) custom function ( not recursive)
Author:
Daniele Raybaudi
Parameters:
_date - any calendar date
startingDay - any number between 1 and 7, where 1 represents Sunday
Data type returned:
number
Description:
Returns a number between 1 and 6 representing the week containing date, figured according to startingDay. startingDay indicates which day is considered the first day of the week.
Comments
Robert D Trammel Nov 3, 2023 |
||
Thanks for this function. I modified it a bit so that it only needs to take the date. /*Data type returned: number Description: Returns a number between 1 and 6 representing the week containing date, figured according to startingDay. startingDay indicates which day is considered the first day of the week. */ Let([ startingDay = DayOfWeek( Date( Month( _date ); 1; Year( _date ) ) ); first = Date ( Month ( _date ) ; 1 ; Year ( _date ) ) ]; WeekOfYear ( _date ) - WeekOfYear ( first ) + 1 - ( DayOfWeek ( _date ) = startingDay - 1 ) + ( DayOfWeek ( first ) = startingDay - 1 ) ) |
||
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.