Brian Dunning's FileMaker Custom Functions

NthDayOfMonth ( N ; shortDayName ; monthNo ; yearNo )

Provides the Nth occurrence of an abbreviated "day name" for a given month and year

  Be the first to rate this function Log in to vote

Ralph Learmont   Ralph Learmont - Show more from this author

Share on Facebook Share on Twitter

  Sample input:
To get the 4th Sunday for October 2023 enter: NthDayOfMonth ( 4 ; "Sun" ; 10 ; 2023 )
  Sample output:
22/10/2023 //Depends on country's date format. Here it's 22nd October 2023

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

Important: Use the short 3 character dayName such as "Sun" , "Mon" , "Tue" etc.

Instead of using a day's number such as seen in Filemaker's "DayOfWeek" function, I found it's easier to refer directly to a day's literal name rather than having to remember for example if a "Sunday" is the 1st or the 7th day of a week.

I found it useful for providing an ongoing calendar of monthly events (based on a pattern), such as the monthly "Market Day" to be held "on the 4th Sunday" of every month.

 

Comments

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.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: