I've been trying to create scripts for the first time and most of my questions have been answered by a quick Google search, but I've now run into a situation that I can't seem to solve:
I want my script to return today's date if the day of the month is the 5th, 10th, 15th, 20th, 25th, or 30th. If today's date falls somewhere in between these days, I want it to return the most recent previous 5/10/15/20/25/30 date.
Here's my best try at it, but still can't get it to work:
FormatTime, Date1, %Date1%, MMddyy
If A_dd between 01 and 04, dd=30 AND MM += -1
If A_dd between 06 and 09, dd=05
If A_dd between 11 and 14, dd=10
If A_dd between 16 and 19, dd=15
If A_dd between 21 and 24, dd=20
If A_dd between 26 and 29, dd=25
If A_dd equals 31, dd=30
Else (??? Not sure if I need an "else" line, or it will just default to today's date if none of above conditions are met. If I need another line, maybe something like If A_DD equals 5 OR 10 OR 15 OR 20 OR 25 OR 30, Date1)
I could probably get it to work by adding an IF line for each day of the month, eg.
But I figure there's probably an easier wayIf A_DD equals 07, Date1 += -2, days
IF A_DD equals 08, Date1 += -3, days
Thanks for any help you can provide!