Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Beginning and end of last month

I am looking for a solution that would give me the beginning and ending dates of the previous month based on the current date.

Any help is greatly appreciated.

Thanks! [:D]

1 Solution

Accepted Solutions
Not applicable
Author

MonthStart(AddMonths(Today(), -1))
MonthEnd(AddMonths(Today(), -1))


This should work for any date. For example, on 10/31/2010, AddMonths(Today(), -1) would return 9/30/2010. In other words, the AddMonths(Date, -1) shouldn't return an invalid date.

View solution in original post

3 Replies
Not applicable
Author

MonthStart(AddMonths(Today(), -1))
MonthEnd(AddMonths(Today(), -1))


This should work for any date. For example, on 10/31/2010, AddMonths(Today(), -1) would return 9/30/2010. In other words, the AddMonths(Date, -1) shouldn't return an invalid date.

pover
Luminary Alumni
Luminary Alumni

You can also take advantage of the offset parameter found in many date functions to simplify the formula to

MonthStart(Today(), -1)
MonthEnd(Today(), -1)
Regards.
Not applicable
Author

Worked like a charm!

Thanks, Miller!