Run Script every Monday-Delete data over a week old from the last Monday
Hey Everyone.. Need some advice how you guys might go about this:
I am looking to run a script that will go through and delete records older than 1 week as of Monday. (Not just 7 days) For instance: If I create a record on Friday, then when Monday comes around the Friday record will be deleted since we are only keeping records from Monday - Sunday.
But what happens if they don't open the database until Tuesday or Wednesday? How would you guys ensure the script goes back and only deletes the records that are older than the prior Monday, keeping in mind the script could be ran on any day?
I have looked through all the date functions but don't know which one to use??