Brian Dunning's FileMaker Custom Functions

PreviousMonthEndDate ( myDate )

Shows the end date of the previous month

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

John Gibbs   John Gibbs
N/a
http://gibbs-it.tech

Share on Facebook Share on Twitter

  Sample input:
PreviousMonthEndDate( 01/03/2018)
  Sample output:
28/02/2018

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

Shows the end date of the previous month

 

Comments

Tim Anderson   Tim Anderson, Tim Anderson Group
Mar 7, 2018
You could try

date( month ( myDate ) ; 1 ; year ( myDate ) )- 1
 
19752   19752, fmc
Mar 7, 2018
You use many variable but they all used only once, it can be written as
myDate - Day ( myDate )
//date - number is date, then don't need getasdate.

And the parameter myDate should be date type, then sample input is wrong. Something like
PreviousMonthEndDate( GetAsDate("01/03/2018"))
 
Bernard Moreau   Bernard Moreau, Borchtlombeek, Belgium
Mar 9, 2018
Tim, even shorter :

date( month ( myDate ) ; 0 ; year ( myDate ) )
 

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: