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


Kirklees
2011-03-31T14:49:07Z
Hi,

I have created a new variable in the format of
{DATEFORMAT(yyyy-MM-dd)} which outputs 2011-03-31

I want to incorporate this into an SQL script (below), but I would like to take away 2 from the current date so I can use it to clean up files older that 2 days.

So in the case above I would like the variable to output 2011-03-29

Is this possible or should I be doing it another way?

Thanks in advance!




EXECUTE master.dbo.xp_delete_file 0,N'H:\SQL Backups\User',N'bak',N'{DATEFORMAT(yyyy-MM-dd)}'



Sponsor
Forum information
Support
2011-03-31T14:50:48Z
{DATENOWADD(Days|-2|yyyy-MM-dd)}
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Kirklees
2011-03-31T15:02:42Z
Thanks for the quick reply!

Although, happen I had scrolled down the list a bit more I would have worked it out myself!

Oops 😊
Scroll to Top