Jump to content
Server Maintenance This Week. ×

Calculate the date for the last day of the previous month


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

Recommended Posts

I'm looking for a simple calculation for the date of the last day of the previous month, based on Get(CurrentDate)?

I can use month(get(CurrentDate)-1, but wondered if there is an easy way to calculate this, other than a complex calculation for the day, based on 28, 29, 30, 31 days in the given months?

Thanks,

 

Bill

Link to comment
Share on other sites

8 minutes ago, Bill_misc_IT said:

wondered if there is an easy way to calculate this

Here's one:

Let ( 
today = Get ( CurrentDate )
;
today - Day ( today )
)

Here's another:

Let ( 
today = Get ( CurrentDate )
;
Date ( Month ( today ) ; 0 ; Year ( today ) )
)

 

Link to comment
Share on other sites

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