Jump to content

Calculating a timestamp


jim.davidson

Recommended Posts

Depends on what you mean by "check".  Do you want to select records that are 14 days or older or not select records that are 14 days or older?  This will do those:

 

Older than 14 days:

SELECT * FROM table_name WHERE (  TO_DAYS(CURDATE()) - TO_DAYS(column_name)  ) > 14

 

Not older than 14 days:

SELECT * FROM table_name WHERE (  TO_DAYS(CURDATE()) - TO_DAYS(column_name)  ) <= 14

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.