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)}'