Bei Anpassungen von Reports sind gelegentlich vorbereitete Zeiträume zielführend und hilfreich:
Select dateadd(SECOND, -1, [dbo].fn_UTCToLocalTime([dbo].[fn_EndOfToday](getutcdate()))) as EndOfToday ,[dbo].fn_UTCToLocalTime([dbo].[fn_BeginOfThisWeek](getutcdate())) as BeginOfThisWeek , dateadd(SECOND, -1, [dbo].fn_UTCToLocalTime([dbo].[fn_EndOfThisWeek](getutcdate()))) as EndOfThisWeek , [dbo].fn_UTCToLocalTime([dbo].[fn_BeginOfLastMonth](getutcdate())) as BeginOfLastMonth , [dbo].fn_UTCToLocalTime([dbo].[fn_BeginOfThisMonth](getutcdate())) as BeginOfThisMonth , dateadd(SECOND, -1, [dbo].fn_UTCToLocalTime([dbo].[fn_EndOfThisMonth](getutcdate()))) as EndOfThisMonth , [dbo].fn_UTCToLocalTime([dbo].[fn_BeginOfLastYear](getutcdate())) as BeginOfLastYear , [dbo].fn_UTCToLocalTime([dbo].[fn_BeginOfThisYear](getutcdate())) as BeginOfThisYear , dateadd(SECOND, -1, [dbo].fn_UTCToLocalTime([dbo].[fn_EndOfThisYear](getutcdate()))) as EndOfThisYear