November 17, 2020 at 8:19 pm
Hi,
I know =Year(Today) will get me the current 4 digit year.
What I need is the Year of the previous month.
So if the report is run in January 2021, then the default value is 2020, if it is run in December of 2020, then its 2020
Thanks
November 17, 2020 at 8:25 pm
It's funny, when you see something in print, you get it....
I came up with
=Format(DateAdd(DateInterval.Month, -1, Today), "yyyy")
And it works!!!
Thanks
November 17, 2020 at 8:26 pm
select year(eomonth(getdate(),-1))
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
November 17, 2020 at 8:29 pm
Thanks Steve, thats a bit more straightforward 🙂
November 17, 2020 at 9:27 pm
In SSRS:
=Year(Today.AddMonths(-1))
=Today.AddMonths(-1).Year
Jeffrey Williams
“We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”
― Charles R. Swindoll
How to post questions to get better answers faster
Managing Transaction Logs
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply