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 6356 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

I need to calculate the date of the last day of the month a given date is in. If the date is 8/21/2007, I want the calculation to return 8/31/2007.

I am using a calculated global field listed below.

I get the error message "List usage is not allowed in this calculation" with the closing "]" highlighted.

What am I doing wrong, or is there a better algorithm.

--------------------

// To calculate the last day of the month from BLK209 date

Let([

CSODate = g Date BKL209;

CSODay = Day ( g Date BKL209 );

AddDays = If ( CSODay > 15 ; CSODay + 20 ; CSODay + 35 );

NextMonth = getasdate( CSODate + AddDays);

NextYearNo = Year ( NextMonth );

NextMoNo = Month ( NextMonth );

]; // end variable declarations

Date ( Month ( NextMonth ) ; 1 ; Year ( NextMonth ) ) - 1 // Get the first of the next month then subtract 1 day

)

Posted

The date of the last day of the month is the day before the first of the next month.

Date( month + 1 ; 0 ; year )

Let(

[

month = Month( g Date BKL209 ) ;

year = Year ( g Date BKL209 )

] ;

Date ( month + 1 ; 0 ; year )

)

This topic is 6356 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.