Vipul Thakur
Vipul Thakur

Reputation: 21

SQL Server Agent Job - Schedule based on last working day of month

I need to run a SQL Server Agent Job once monthly, two days prior to the last working day of the month.

So if, for example, the last working day of the month is Friday the 28th, the job would run on Wednesday the 26th, two days prior to it.

Is there a way to use this schedule option in an Agent job?

Upvotes: 1

Views: 1760

Answers (1)

Seany
Seany

Reputation: 149

In the job, you can create a step to check the date and abort the job if necessary. The trick is to set the "On failure action" to "Quit the job reporting success." For details see here

Upvotes: 3

Related Questions