在SSRS中显示上周的周日和上周的周六,可以通过以下步骤实现:
Public Function GetLastSunday() As DateTime
Dim currentDate As DateTime = Today
Dim dayOfWeek As Integer = currentDate.DayOfWeek
Dim lastSunday As DateTime = currentDate.AddDays(-dayOfWeek)
Return lastSunday
End Function
Public Function GetLastSaturday() As DateTime
Dim currentDate As DateTime = Today
Dim dayOfWeek As Integer = currentDate.DayOfWeek
Dim lastSaturday As DateTime = currentDate.AddDays(-dayOfWeek - 1)
Return lastSaturday
End Function
=Code.GetLastSunday()
=Code.GetLastSaturday()
这样,通过自定义代码函数,可以在SSRS报表中显示上周的周日和上周的周六的日期。
领取专属 10元无门槛券
手把手带您无忧上云