0
votes

For example I would like the expected output to be 8/21/2018. I have an expression to get the month of August of 2018 below, but not sure how to modify to get through the same date instead of returning the full month.

=DateAdd(DateInterval.Month, -12, DateAdd(DateInterval.Day,-Day(Today())+1,Today()))

1
Would it not be =DateAdd(DateInterval.Year, -1, Today()) to give you today's date 1 year ago?B. Seberle
Thank you that's correct, but I am wanting to grab just the month of August, so Aug 1 to today's date 1 year ago. I know I am so close and feel silly having to post a question. I appreciate the response.lizfrinko
Perhaps this might give you some direction: pragmaticworks.com/portfolio/ssrs-expressions-cheat-sheetB. Seberle

1 Answers

0
votes

If I get this correctly you want one year ago from a given date with todays day?

'Today:  8/23/2019
'Input:  8/21/2019
'Output: 8/23/2018

That would be this expression:

=DateSerial(Year(DateAdd("yyyy", -1, CDate("8/21/2019"))), 
            Month(CDate("8/21/2019")), 
            Day(Today()))