-
1. Re: Custom tabcmd Refresh
Toby ErksonJan 2, 2013 11:44 AM (in response to Mark Bingham)
10 days after the last Sunday would be a Wednesday...
-
2. Re: Custom tabcmd Refresh
Mark Bingham Jan 2, 2013 11:48 AM (in response to Toby Erkson)Excuse me - 10 business days (or weekdays).
-
3. Re: Custom tabcmd Refresh
Joshua Milligan Jan 2, 2013 11:54 AM (in response to Mark Bingham)Hi Mark!
I'm sure the date logic could be written in a batch script. But it might be easier, in the script that calls tabcmd, to have a list (or separate file) of dates and check to see if the current date is contained in that list and use that as a condition of whether or not to execute the refresh. You should be able to find examples of that kind of batch logic online.
I found a SQL script and modified it, so that it generates a list of dates that fits your logic. I've attached the resulting dates. You might double check my results. Here's the SQL script:
SELECT CAST(DATEADD(DAY, 10, (DATEADD(day, DATEDIFF(day,'19000107', DATEADD(month, DATEDIFF(MONTH,0,First_Day_Of_Month), 30))/7*7,'19000107'))) AS DATE)
FROM
(
SELECT '01/01/2013' AS month_date
UNION ALL
SELECT '02/01/2013' AS month_date
UNION ALL
SELECT '02/01/2013' AS month_date
UNION ALL
...
) m
Message was edited by: Joshua Milligan I realized you said last Sunday, not Saturday. I've attached a different file and updated the script inline.
-
Ten Days After the Last Sunday.txt.zip 480 bytes
-
Ten Days After the Last Saturday.txt.zip 482 bytes
-
-
4. Re: Custom tabcmd Refresh
Joshua Milligan Jan 2, 2013 11:57 AM (in response to Joshua Milligan)I just noticed you added "business days". That would change the above a little.
-
5. Re: Custom tabcmd Refresh
Mark Bingham Jan 2, 2013 12:03 PM (in response to Joshua Milligan)Thanks Joshua! Although that wasn't the specific command I was loooking for, I think it is the most straightforward solution to my problem. Thanks for helping me think outside the box!