6th working day

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
diehl7

6th working day

Post by diehl7 » Wed Dec 10, 2003 7:52 pm

Is there any way to schedule a job the 6th working day of each month.
thanks

User avatar
Captive
Macro Veteran
Posts: 213
Joined: Sun Oct 20, 2002 8:37 pm
Location: Colorado, USA

Post by Captive » Wed Dec 10, 2003 9:32 pm

Yeah, use this logic.
Have the script run every day, and let the script itself check if it's the 6th day:

If it's the 8th, 9th, or 10th of the month, continue (else end script)

Check the day of the week:

If it's the 8th, then:
- Saturday or Sunday, end script
- (Any other day = 6th working day of month)

If it's the 9th, then:
- Monday, it's the 6th day.
- else end script

If it's the 10th, then:
- Monday, it's the 6th day.
- else end script.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Thu Dec 11, 2003 12:20 am

Captive's logic is good, but many holidays fall on Mondays now, and usually upsets "workday" calculations.

:idea: Could also make an INI file listing the first workday of each month. Based on run date, look up key value for that year/month. If same date, go to work, if different date, take the day off. Example assumes workdays are Mon-Fri.

Example INI file:
[2004]
Jan=8
Feb=11
Mar=10
...
...
Dec=8

[2005]
Jan=10
Feb=8
...
...
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts