Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


Marco
  •  Marco
  • No customer Topic Starter
2010-09-14T17:44:29Z
Hi all,
I need to use a Variable that tell me the date of 3 work days ago
Is it possible?
Thanks
Marco
Sponsor
Forum information
ErikC
2010-09-15T08:37:08Z
There is already a last worday variable, but you cannot use this in your situation.

We might think of something like:


{WORKDAYADD(Days|1|M/d/yyyy)}


or in the past:

{WORKDAYADD(Days|-3|M/d/yyyy)}



So it should be a feature request.


Regards
Erik
Uses Visualcron since 2006.
ErikC
2010-09-15T09:00:09Z
You can use also an external tool for this too.

I used FDATE  for this in a batch file:

for /f %%i in ('FDATE /Ff /Odow#') do (
	REM Get the date of 3 work days ago
	if %%i==1 fdate /Fsub /n4 /Occyymmdd : REM now Sunday so go 4 days back
	if %%i==2 fdate /Fsub /n5 /Occyymmdd : REM now Monday so go 5 days back
	if %%i==3 fdate /Fsub /n5 /Occyymmdd : REM now Tuesday so go 5 days back
	if %%i==4 fdate /Fsub /n5 /Occyymmdd : REM now Wednesday so go 5 days back
	if %%i==5 fdate /Fsub /n3 /Occyymmdd : REM now Thursday so go 3 days back
	if %%i==6 fdate /Fsub /n3 /Occyymmdd : REM now Friday so go 3 days back
	if %%i==7 fdate /Fsub /n3 /Occyymmdd : REM now Saterday so go 3 days back
)


Regards
Erik
Uses Visualcron since 2006.
Scroll to Top