Brian Dunning's FileMaker Custom Functions

MonthNameList ( start ; number ; short )

List of short or full month names

  Average rating: 4.8 (32 votes) Log in to vote

David Head   David Head - Show more from this author
uLearnIT
http://www.ulearnit.com.au/

Share on Facebook Share on Twitter

  Sample input:
MonthNameList ( 3; 6; 0 )

MonthNameList ( 7; 3; 1 )
  Sample output:
"March¶April¶May¶June¶July¶August"

"Jul¶Aug¶Sep"

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

Returns a return-delimited list of month names starting from the specified month number

 

Comments

Alex Bassin   Alex Bassin, SYNAP
Aug 29, 2019
Here is a modification on this function

//MonthYearList ( StartDate; EndDate; display )
/*
- returns a return-delimited list of month and years starting based on a date range
Parameters
- short: 1= Full month name, 2= short month name, 3= number of month / year, 4=as date (first of the month)
Credit: Alex Bassin, SYNAP Corporation - www.synap.net
Special thanks to David Head who build the original
*/
Let ( [

//TEST
/*
StartDate="1/1/2018";
EndDate= "5/1/2023;
display=1;
*/

//-----------------------
NumberofMonths = Abs(Round (GetasNumber(GetAsDate (EndDate) - GetAsDate ( StartDate ) )/30 ;0));
StartMonth= Month ( GetAsDate (StartDate) );
StartYear= Year ( GetAsDate (StartDate) );
~year = If (
StartMonth ≥ 13 ;
If (
PatternCount ( StartMonth / 12 ; "," ) > 0 ;
StartYear + Int ( StartMonth / 12 ) ;
StartYear + ( Int ( StartMonth / 12 ) - 1 )
) ;
StartYear
) ;
~mn = MonthName ( Date ( StartMonth ; "1" ; ~year ) ) & " " & ~year
] ;

Case (
display = 2 ; Left ( ~mn ; 3 ) & " " & ~year ;
display = 3 ; StartMonth & "/" & ~year ;
display = 4 ; Date (StartMonth; 1; & ~year) ;

~mn )

&

If ( NumberofMonths > 1 ;
¶ & MonthYearList (
Date (StartMonth + 1 ; 1 ; StartYear);
EndDate ;
display
)
)
)
 
Alex Bassin   Alex Bassin, SYNAP
Aug 29, 2019
See updates at https://www.briandunning.com/cf/2294
 

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: