AnsweredAssumed Answered

Run Script every Monday-Delete data over a week old from the last Monday

Question asked by AppGuy on Jan 14, 2014
Latest reply on Jan 14, 2014 by philmodjunk

Title

Run Script every Monday-Delete data over a week old from the last Monday

Post

     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??

     Thanks,

     JP

Outcomes