Page 1 of 1

testing datetimes

Posted: Sun Mar 29, 2009 4:06 pm
by cone13cone
Im having a rough time with dates in php and mysql, whats the best way to write a query along these lines...
SELECT *
FROM table
WHERE datefield = today

and then
SELECT *
FROM table
WHERE datefield = past 3 days not including today


all my dates are stored in DATETIME format.

Thanks for the help, john

Re: testing datetimes

Posted: Wed Apr 01, 2009 2:20 am
by jaoudestudios
Take a look at this...http://dev.mysql.com/doc/refman/5.1/en/ ... tions.html
You can use the BETWEEN command too.

Re: testing datetimes

Posted: Wed Apr 01, 2009 2:44 am
by pradeep_oscorp
No idea abt ii