This blog contains tips and tricks for reporting services 2005/2008R2/2016 "This blog is provided 'AS IS' with no warranties, and confers no rights."
Thursday, 8 November 2012
Create a data driven subscription for the last working day
The standard scheduling reporting services 2008 r2 does not include the last day of the month.
A workaround is to use sql code in a data driven subscription to create this schedule.
The code is shown below:
I have used a function to strip out the time ...
CREATE FUNCTION wfDateWithoutTime
(@datewithtime DATETIME)
RETURNS SMALLDATETIME
AS
BEGIN
DECLARE @datestring AS VARCHAR(20)
SET @datestring = CONVERT(VARCHAR(20),@datewithtime,101)
RETURN CONVERT(SMALLDATETIME, @datestring)
END
The t sql code is then used in the sql query of the data driven subscription as follows:
with cte as
(select DATEADD(m, DATEDIFF(m, 0, GETDATE())+1, 0) -1 as tday)
select * from cte where tday = (select dbo.wfdatewithouttime(getdate()))
You then need to set the data driven subscription to run on a daily basis. The subscription will then only run on the last day of the month.
Subscribe to:
Post Comments (Atom)
Keep SSRS (SSRS2016) report manager awake
When running a report for the first time in report manager it takes a while to run, after this initial run reports run fine. There are a ...
-
Due to the fact the reporting services allows you to query the tables you can easily write SQL which will allow you to return data from the ...
-
I have recently been looking at conditional page breaks in SSRS 2008 r2 and did not know that it is possible to do via an expression. For...
-
To add alternate colors in a matrix the expression should be as follows for the row group: =IIf( RunningValue (Fields!FIELDNAME.Value, Co...
No comments:
Post a Comment