Brian Dunning's FileMaker Custom Functions

LastSaturdaysInRangeSQL ( startDate ; endDate )

Returns a comma-separated list of SQL-formatted dates representing the last Saturday of each month between the start and end dates.

  Be the first to rate this function Log in to vote

Jonni™   Jonni™ - Show more from this author

  Sample input:
LastSaturdaysInRangeSQL ( Get ( CurrentDate ) ; Get ( CurrentDate ) + 365 )
  Sample output:
'2024-01-27', '2024-02-24', '2024-03-30', '2024-04-27', ...

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

Generates a list of dates in SQL 'YYYY-MM-DD' format for the last Saturday of each month within a given date range. This function uses recursion to iterate through months, making it compatible with FileMaker versions prior to 18 which do not support the While function.

The resulting list is formatted for direct use in SQL IN (...) clauses.

 

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