周末日期的 SSRS 表达式

SSRS Expressions For end of week date

我需要使用 SSRS 表达式来查找两个日期 -

  1. The date that's the end of this week.
  2. The dates that's the start of the week, 2 weeks ago.

例如,如果今天是 27/05/2016

1 = 29/05/2016

2 = 09/05/2016

这需要是动态的,例如getdate()

我正在使用这些函数来过滤矩阵。

谢谢。

可能是下面这样的,

1.本周结束的日期。

=DateAdd("d", 7 - DatePart("w", CDate(Today)), CDate(Today).AddDays(1)).ToString("dd/MM/yyyy")

2。一周开始的日期,2 周前。

=DateAdd("d", 2 - WeekDay(Today), DateAdd("d", -14, Today).ToString("dd/MM/yyyy")

SSRS Expression Cheat Sheet

可能是这样的,
本周结束

 =DateAdd("d", 8 - Weekday(Today), Today).ToString("dd/MM/yyyy")

本周开始(2 周前)

 =DateAdd("d", -(Weekday(Today)+12) , Today).ToString("dd/MM/yyyy")