Properly adds months to dates
Be the first to rate this function Log in to vote
|Ian Summerfield - Show more from this author|
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
You don't need this function! Please don't tell me you can simply add to the month using the date function! You can't. If you are working with Payrolls or something similar, you need this function.
I wanted to pay someone on the 30th of each month, but there is no 30 in February. Filemaker handles this by simply wrapping over in the next month, resulting in the 2nd March. Any normal company will pay on the last day on the month instead. This function deals with it, it'll return 28th Feb or 29th Feb as needed by simply seeing the day no longer matches after adding the required amounts of months and then reverting to 1st of that month and deducting a day, that gives the last day of the month, Jan 30 + 1 month = Mar 03; make that Mar 01 and deduct a day; result = Feb 28 or 29.
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.