Reputation: 305
i want to calculate previous months from current month in SSRS with the format like this: MM-YYYY, for example: 10-2016,11-2016
Can you please help me how to do it?
Thanks
Upvotes: 0
Views: 8799
Reputation: 818
You can do it like this for month previuos to current month:
=Format(DateAdd(DateInterval.Month, -1, Today), "MM-yyyy")
First you DateAdd(DateInterval.Month, -1, ...)
substract one month from the date you specified (...
), and then format the result date. To get required month you need to set -1, -2, ..., -n appropriately.
Upvotes: 2