Re: Pulling Date from MySQL then subtract

From: Date: Sat, 22 Jan 2005 15:58:57 +0000
Subject: Re: Pulling Date from MySQL then subtract
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-38264@lists.php.net to get a copy of this message
Jess Hunter wrote:
I am needing some clarification on doing math with dates pulled from MySQL. The date format in the database is YYY-MM-DD and what I want to do is pull the date out, then add/subtract 30 days from the date.
SELECT yourdatecolumn - INTERVAL 30 DAY FROM yourtable WHERE ... -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com

« previous php.db (#38264) next »