Jump to content

Calculate the date for the last day of the previous month


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 post
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 post
Share on other sites

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.