Re: Pulling Date from MySQL then subtract

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux