Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reporting services SSRS表示当年第一周的第一天_Reporting Services - Fatal编程技术网

Reporting services SSRS表示当年第一周的第一天

Reporting services SSRS表示当年第一周的第一天,reporting-services,Reporting Services,各位,, 我有一个问题困扰了我一天,弄不明白。我要找的是SSRS表达式中的公式,它将告诉我今年第一个ISO周的第一天的日期。 例如: 2014年收益率:12/30/2013。原因是2014年的第一个ISO周从(2013年12月30日)-(2014年5月1日)开始 2013年收益率:12/31/2012 我会很感激任何人的帮助? 谢谢,您可以使用此功能: Public Function dtFirstDayOfISOYear(ByVal intYear As Integer) as Datet

各位,, 我有一个问题困扰了我一天,弄不明白。我要找的是SSRS表达式中的公式,它将告诉我今年第一个ISO周的第一天的日期。
例如:

  • 2014年收益率:12/30/2013。原因是2014年的第一个ISO周从(2013年12月30日)-(2014年5月1日)开始
  • 2013年收益率:12/31/2012
我会很感激任何人的帮助?
谢谢,

您可以使用此功能:

Public Function dtFirstDayOfISOYear(ByVal intYear As Integer) as Datetime

    'the first week of a ISO year is the week that contains the first Thursday of the year (and, hence, 4 January)
    Dim intDayOfWeek As Integer = CInt(New DateTime(intYear, 1, 4).DayOfWeek)

     'ISO weeks start with Monday
    If intDayOfWeek < DayOfWeek.Monday Then intDayOfWeek = intDayOfWeek + 7

    Return DateAdd(DateInterval.Day, -intDayOfWeek + 1, New DateTime(intYear, 1, 4))

End Function
您还可以使用如下独立表达式:

=Code.dtFirstDayOfISOYear(2014)
=DateAdd("d", (-1) * (CInt(New DateTime(2014, 1, 4).DayOfWeek) + IIf(CInt(New DateTime(2014, 1, 4).DayOfWeek) < DayOfWeek.Monday, 7, 0)) + 1, New DateTime(2014, 1, 4))
=DateAdd(“d”,(-1)*(CInt(新日期时间(2014,1,4).DayOfWeek)+IIf(CInt(新日期时间(2014,1,4).DayOfWeek)