5 Replies Latest reply on Jan 14, 2014 3:25 PM by philmodjunk

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

    AppGuy

      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