Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 4299 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I tried to get the next month name with a calculation field but I only got the current month name with this:

 

MonthName (Get ( CurrentDate ))

 

I thought adding "+ 1" at the end would move the result to the next month

 

Thanks for your tips

Posted

Let(

today = Get(CurrentDate);

MonthName(Date(Month(today) +1; Day(today); Year(today)))

)

Posted

Your calculation needs to be amended. Try something like

 

Date ( Month ( YourDateLay::date ) +1 ; Day ( YourDateLay::date ) ; Year ( YourDateLay::date ) ) result equals Date

 

Use the Inspector to display only the month

 

Doug you are too fast for me today. :)

Posted

Doug and Lee's results are in the right direction, but they'll get the wrong result during the last days of longer months: the calculation will return "March" on 31 January, for example. Try using 1 for the day of the month instead of Day ( Get ( CurrentDate ) ) instead:

 

Let ( [
    ~date = Get ( CurrentDate )
] ;
    MonthName ( Date ( Month ( ~date ) + 1 ; 1 ; Year ( ~date ) ) )
)
 
  • Like 1
Posted

MonthName ( Get ( CurrentDate ) - Day ( Get ( CurrentDate ) ) + 32 )

 

Clever, possibly too clever for its own good. While correct and possibly more performant, it's less obvious what the intention of the calculation is if the next maintenance developer doesn't already know, but this is simple enough for that to be OK with a good explanatory comment (which I'd feel the need to add even to my own in a production solution): /* name of next month */

This topic is 4299 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.