Reputation: 135
I need to use an SSRS expression to find two dates -
- The date that's the end of this week.
- The dates that's the start of the week, 2 weeks ago.
For example, if today is 27/05/2016
1 = 29/05/2016
2 = 09/05/2016
This needs to be dynamic e.g. getdate()
I'm using these functions to filter a matrix.
Thanks.
Upvotes: 1
Views: 3189
Reputation: 6508
It may be something like below,
1. The date that's the end of this week.
=DateAdd("d", 7 - DatePart("w", CDate(Today)), CDate(Today).AddDays(1)).ToString("dd/MM/yyyy")
2. The dates that's the start of the week, 2 weeks ago.
=DateAdd("d", 2 - WeekDay(Today), DateAdd("d", -14, Today).ToString("dd/MM/yyyy")
Upvotes: 1
Reputation: 144
May be something like this,
End of this week
=DateAdd("d", 8 - Weekday(Today), Today).ToString("dd/MM/yyyy")
Start of the week (2 weeks ago)
=DateAdd("d", -(Weekday(Today)+12) , Today).ToString("dd/MM/yyyy")
Upvotes: 0