Brian Dunning's FileMaker Custom Functions

LastDayOfMonth ( theDate )

Returns the date of the last day of the specified month

  Average rating: 4.5 (33 votes) Log in to vote

Darren Terry   Darren Terry - Show more from this author
Pacific Data Management, Inc.
http://www.pdm-inc.com

Share on Facebook Share on Twitter

  Sample input:
LastDayOfMonth ( Date ( 7 , 5, 2006 ))
  Sample output:
7/31/2006

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

The last day of the specified month is the "0th" day of the next month. FileMaker performs the math. This function will work for any month (including December), and will handle leap years just fine.

 

Comments

HazMatt   HazMatt, Blaine, MN USA
Oct 20, 2012
I had trouble wrapping my brain around this and had to try this in a test database to see how it actually worked.

A supplied date of 12/15/2000 would evaluate to "13/0/2000", and FileMaker does the math, properly returning "12/31/2000".

Nice, simple function!
 

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: