I need to be able to determine the date of the next "non-weekend" day during the execution of a script.
so, I'm thinking a VB routine. pass it a variable with the date, VB adds converts it to julian, adds one, then determines the DayName or the numeric day of week (1 - 7), and passes this back to MSched.
Anyone done this?
SkunkWorks
Next Business Day
Moderators: JRL, Dorian (MJT support)
-
- Automation Wizard
- Posts: 1101
- Joined: Fri Jan 07, 2005 5:55 pm
- Location: Somewhere else on the planet
I did something similar a while ago. I spent a lot of time on the Julian thing before realizing it was overkill if you are just dealing with the current day.
If you get Dayofweek> then there are only 3 possible cases for incrementing the current date to get to work day and a series of If>'s will handle it.
If the day is 1 through 5 then add 1 day
If the day is 6 add 3 days
If the day is 7 add 2 days
If you need non-current dates then your approach sounds OK.
If you get Dayofweek> then there are only 3 possible cases for incrementing the current date to get to work day and a series of If>'s will handle it.
If the day is 1 through 5 then add 1 day
If the day is 6 add 3 days
If the day is 7 add 2 days
If you need non-current dates then your approach sounds OK.