question

jonlellelid avatar image
jonlellelid asked

Reporting Services My Subscriptions: Last Day of Month

Is there way to schedule a job in Reporting Services> My Subscriptions to run on the “last” day of the month regardless of the number of days in the month? I set up 4 subscriptions to the same job, one for months with 28 day, 29 days, 30 days or 31 days. I check the appropriate months for each of those days, yet I get reports on day 28 in those months with 30 or 31 days.
ssrs-subscription
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Pavel Pawlowski avatar image
Pavel Pawlowski answered
As @raadee mentioned you can alter the job created by the schedule, but better way than changing the Agent job for the Schedule is, take the code which the Agent job is calling and create new job. It will be something like: exec [reportserverdb].dbo.AddEvent @EventType='TimedSubscription', @EventData ='GUID of the subscription'. Then create new job with appropriate schedule and simply call that code from your job. once your new job is created alter the subscription so it should be executed only once, but in past. It will update the original agent job so it will never trigger. Eventually create a Shared Schedule "Disabled" with execution time in past. Such Shared Schedule you can than use to disable the schedules. (You will have single job without schedule in the agent for all such disabled subscriptions). Creating separate job, is a better solution, because your changes to the job created by SSRS are not guaranteed. SSRS traverses periodically through the subscriptions and aligns the jobs according the subscription specification. With separate job, you will be sure, your schedule will not be altered.
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

I deleted my post since your solution is preferred. The "traverses periodically" part makes my solution kind of bad. Thanks.
0 Likes 0 ·
jonlellelid avatar image
jonlellelid answered
Thanks Pavel. I set a new job up and will see what happens on the last day of August!
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.