Dates

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
snapper1969
Pro Scripter
Posts: 50
Joined: Fri Mar 23, 2007 10:14 am

Dates

Post by snapper1969 » Thu Apr 26, 2007 4:34 pm

Hi,

I process an excel file either on a friday, monday or tuesday. Is there anyway to send the nearest staurdays date to the spreadsheet?.

Thx,

John

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

Post by Marcus Tettmar » Thu Apr 26, 2007 4:47 pm

Code to get nearest Saturday's date:

Code: Select all

GetDate>thedate
DayOfWeek>dow
If>dow<4
  //If today is Tuesday or less, get Sat gone
  Sub>thedate,dow
else
  //if today is Wed or more, get Sat coming
  Let>dow=7-dow
  Add>thedate,dow
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