Micro tip of the day: How many days has past since a date field in the database?
SELECT (TO_DAYS(NOW()) - TO_DAYS(date_field)) AS days_past FROM tablename
Micro tip of the day: How many days has past since a date field in the database?
SELECT (TO_DAYS(NOW()) - TO_DAYS(date_field)) AS days_past FROM tablename
Tags: mysql
This entry was posted on 2007/04/08, 10:28 and is filed under databases. You can follow any responses to this entry through RSS 2.0. You can leave a response, or trackback from your own site.
Arclite theme by digitalnature | powered by WordPress