Jump to content

Mysql help, Checking if dates are older than 2 week then delete the rows.


Z33M@N

Recommended Posts

CAUTION: I have not tested this and I will not quarantee it will work for sure so I sugges you TAKE BACKUP before running it. But something like this should do it (assuming your date_field is DATETIME format):

 

 

DELETE FROM some_table WHERE date_field < DATE_SUB(NOW(), INTERVAL 14 DAY);

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.