Page 1 of 1

Query all records ordered by date but no knewer than today's

Posted: Wed Apr 02, 2003 12:23 pm
by 3dron
I have dates stores in format 0000-00-00

How do I query dates only older or equal to today's date?

Something like this:

"where date =< date()" ???

Thanks

Ron

Posted: Wed Apr 02, 2003 1:45 pm
by twigletmac
You could do:

Code: Select all

SELECT field1, field2, field3 FROM table WHERE date <= CURDATE()
http://www.mysql.com/doc/en/Date_and_ti ... tions.html

Mac

Posted: Wed Apr 02, 2003 5:35 pm
by 3dron
Great, it worked like a charm!!!