SELECT unix_timestamp( curdate( ) ) AS TODAY, unix_timestamp( DATE_SUB( curdate( ) , INTERVAL 1 YEAR ) ) AS LASTYEAR, unix_timestamp("2005-10-01") AS THISQUARTER, unix_timestamp(DATE_SUB("2005-10-01", INTERVAL 1 YEAR) ) AS LASTQUARTER SELECT (unix_timestamp("2005-11-15") - unix_timestamp("2005-10-01")) / 86400 SELECT * FROM mail_stats WHERE DATE_SUB(DATE_FORMAT( complete_date, "%Y-%m-%d" ),INTERVAL 1 DAY) = "2005-11-09"
Monday, October 18, 2004
Some cool MySQL date manipulation stuff
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment