April 12, 201312 yr 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
April 12, 201312 yr Let( today = Get(CurrentDate); MonthName(Date(Month(today) +1; Day(today); Year(today))) )
April 12, 201312 yr 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.
April 12, 201312 yr 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 ) ) ) )
April 13, 201312 yr What do you think about: MonthName ( Get ( CurrentDate ) - Day ( Get ( CurrentDate ) ) + 32 ) ?
April 13, 201312 yr 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 */
Create an account or sign in to comment