If I understand this.. you want to find the date of "Monday" from the current week, so that come, say Thursday, you can delete Monday's file?

It's all about time arithmetic...

The @DAY function returns the number of days since Sunday, so Monday is 1, Tuesday is 2, etc..

Each day has 86,400 seconds, and seconds is a standard way of expressing time values, called a "cTime". Technically, it's the number of seconds since an "Epoch" (an artificial "beginning of time", like Jan 1, 1900).

The TimeConvert UDF converts a date/time string to a cTime value and cTime values back to date/time strings. The TimeConvert UDF uses a standard epoch value, but you can define your own to use smaller values, like "@YEAR + '/01/01'".

So - what was the date this past Monday? How can I use that to create the file name to delete? Here's a working example using the TimeConvert UDF.
 Code:
$Today  = TimeConvert(@DATE + ' 00:00:00')	; Get the cTime for today at midnight

$DDay   = (Val(@WDAYNO) - 1) * 86400		; Calculate the number of seconds since Monday

$Monday = TimeConvert($Today - $DDay)		; Calculate the cTime for Monday by subtracting the elapsed seconds

' Today: ' @DATE ' / ' $Today ?			; show the Today cTime (debugging)
'  DDay: ' $DDay ?				; show the elapsed secs (debugging)
'Monday: ' Split($Monday, ' ')[0] ?		; show the date for Monday (debugging)

; reformat the date into the computer-unfriendly format ;)
$FileDate = SubStr($Monday, 6, 2) + SubStr($Monday, 9, 2) + Left($Monday, 4)

; Delete the file(s) from Monday
'Deleting files from ' $FileDate ?
Del $FileDate + '*.txt'				; wildcard file delete for matching dates
The same idea can be used for any day, and for longer periods (1 week = 86400*7 seconds)

Glenn

PS - if you want to use TimeConvert, you can get the latest version from the Kixtart pages of my web site - over 200 UDFs are available.
_________________________
Actually I am a Rocket Scientist! \:D