Page 1 of 1

Date Functions

Posted: Thu Mar 04, 2004 10:56 am
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

Posted: Thu Mar 04, 2004 11:02 am
by Weirdan

Code: Select all

select * from domains where expire <= (now() + interval 30 day)

Posted: Thu Mar 04, 2004 11:05 am
by liljester
http://www.mysql.com/doc/en/Date_and_ti ... tions.html

i think they actually have an example of what you want to do near the top =)

Posted: Thu Mar 04, 2004 11:06 am
by Etherguy
Figures.... I always seem to be a word or two off....


Thanks for the quick reponse!!

Regards.