Last Day of Prior Month Formula
I am trying to find a formula that would populate “last day of prior month”. As an example, I would run a report on October 5, 2022, but would want to populate a column in the report with the last day of the prior month , September 30, 2022. Do the experts have any advice?
Answers
-
Hi Linda,
You can utilize the following formula:
lastday (DateAdjust (date,0,-1,0),"month")
In regards to the 'date' field/value you can utilize either 'a run report date' if that exists within the report and "extract" that as a field OR you can use the 'METADATA COLUMN' field FileCreated to then utilize that 'date' within the formula.
HOPE THIS IS HELPFUL.
Rebecca & DA Team
0 -
A couple of thoughts. If you already have a date column and you want to find the last day of the previous month of that date column you could use the DateAdjust() function. I would try this:
dateadjust(date,0,0,-day(date))
Where 'date' is my column that contains the date. Make sure to include the minus (-) before the day function.
If you don't have a date column, you can use:
lastday(dateadjust(today(),0,-1),"month")
1 -
Thank you all so much! Very helpful!
0