Brian Dunning's FileMaker Custom Functions

_SubtractMonths ( vDate ; vLessMonths )

Subtract x number of months from a given date

  Average rating: 4.3 (24 votes) Log in to vote

Makah Encarnacao   Makah Encarnacao
Soliant Consulting
http://www.soliantconsulting.com/

Share on Facebook Share on Twitter

  Sample input:
_SubtractMonths ( "1/26/2015" , 9 )
  Sample output:
4/26/2014

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

This function will subtract months from a given date, for example 5/15/2014 - 3 months = 2/15/2014. It is subtracting from the month value, and does not modify the day value (although FileMaker may automatically modify the day value if the resulting date is not valid). If you would like to add months instead of subtract months, you can tweak the custom function or see my function _AddMonths or enter a negative value for the 2nd parameter.

 

Comments

Tim Anderson   Tim Anderson, Tim Anderson Group
Sep 2, 2015
As I have suggested for you _AddMonths cf, just subtract the number of months, FileMaker will sort out the years
 

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: