First Tuesday of each Month

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
DutchS
Newbie
Posts: 1
Joined: Tue Feb 27, 2018 2:03 pm

First Tuesday of each Month

Post by DutchS » Tue Feb 27, 2018 2:16 pm

I have 25 laptops that I need to do a monthly popup on their screen on a Monday to remind them that the following 1st, 2nd, 3rd, or 4th Tue they are scheduled for maintenance. I have found code that will determine the day of the week but not finding anything yet that tells me if this is the 1st, 2nd, 3rd, or 4th occurrence of this day of the week in the current month.

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: First Tuesday of each Month

Post by Marcus Tettmar » Tue Feb 27, 2018 5:42 pm

The first Tuesday of the month must be the third day of the week and less than the 8th day of the month:

Code: Select all

DayOfWeek>todays_dayofweek
Day>todays_dayofmonth
If>todays_dayofweek=3
  If>todays_dayofmonth<8
    //today must be first tuesday of the month
  Endif
Endif
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

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