Brian Dunning's FileMaker Custom Functions

getDatesMonth ( theDate ; operator ; months )

Returns a list of all dates in the month of a given date

  Be the first to rate this function Log in to vote

Jonni™   Jonni™ - Show more from this author

  Sample input:
getDatesMonth ( Get ( CurrentDate ) ; "+" ; "2" )
  Sample output:
01/09/2026
02/09/2026
03/09/2026
04/09/2026
05/09/2026
06/09/2026
07/09/2026
08/09/2026
09/09/2026
10/09/2026
11/09/2026
12/09/2026
13/09/2026
14/09/2026
15/09/2026
16/09/2026
17/09/2026
18/09/2026
19/09/2026
20/09/2026
21/09/2026
22/09/2026
23/09/2026
24/09/2026
25/09/2026
26/09/2026
27/09/2026
28/09/2026
29/09/2026
30/09/2026

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

This function finds the first and last day of the month containing theDate (optionally
shifted forward/back by a whole number of months via operator + months -- FileMaker's
Date() function normalises month overflow/underflow automatically, so year boundaries
are handled without extra logic), then returns every date in that month as a
return-delimited list. List() silently drops the Case() branches that fall outside the
month's actual day count, so short months (28/29/30 days) work without extra branching.
Companion function to getWeekDates.

getDatesMonth ( "1/1/2026" ; "-" ; 1 )
1 week before Jan 1 2026's week

 

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 22 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: