MJCookie
MJCookie

Reputation: 135

SSRS Expressions For end of week date

I need to use an SSRS expression to find two dates -

  1. The date that's the end of this week.
  2. 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

Answers (2)

Pedram
Pedram

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")

SSRS Expression Cheat Sheet

Upvotes: 1

Naveen
Naveen

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

Related Questions