Datepart("yyyy", DateAdd("M",-2,Now)) This does not work. Can you help
It looks like you're trying to get the year for the day two months ago:
=DatePart(DateInterval.Year, DateAdd(DateInterval.Month, -2, Now()))
Edit after comment
In your expression in the comment you're getting an error trying to add a string and an integer together.
So it looks like the actual requirement is to get a string like {Month name}-{year}
.
You can do this by applying a Format expression to the date, either in the textbox directly:
=Format(DateAdd(DateInterval.Month, -2, Now()), "MMMM-yyyy")
Or add MMMM-yyyy
as the Format property to a textbox with the very first expression:
Either way, for today you get:
This also workes when we replace '+' with '&' symbol...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With