Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.
Moderator: General Moderators
-
Etherguy
- Forum Commoner
- Posts: 70
- Joined: Fri Nov 01, 2002 9:09 pm
- Location: Long Island, New York
Post
by Etherguy »
Morning Happy Campers,
I am trying to see if a date in my date column will happen within the next 30.60.90 days.
When I use.
Code: Select all
select * from domains where expire <= (now() + 30)
I seem to get results of dates that are not set ( ie... 0000-00-00) but no matter what I set the + number to I always get the same results.
Any one have an idea of how to get the results of days that will expire in the future??
Regards
-
Weirdan
- Moderator
- Posts: 5978
- Joined: Mon Nov 03, 2003 6:13 pm
- Location: Odessa, Ukraine
Post
by Weirdan »
Code: Select all
select * from domains where expire <= (now() + interval 30 day)
-
Etherguy
- Forum Commoner
- Posts: 70
- Joined: Fri Nov 01, 2002 9:09 pm
- Location: Long Island, New York
Post
by Etherguy »
Figures.... I always seem to be a word or two off....
Thanks for the quick reponse!!
Regards.