Forum Moderators: open

Message Too Old, No Replies

Filter MySQL results by todays date

probably so easy I will get flamed for this!

         

delboy1978uk

5:37 pm on Nov 7, 2005 (gmt 0)

10+ Year Member



OK - Here's the setup:

Dreamweaver Site
MySQL Database
JSP Pages (irrellevent to this question)

Question:

I have a load of info in a database, each row has a TIMESTAMP.

I wish to have a page that displays the items added to the database for THAT DAY ONLY.

I think it should be something like
SELECT * FROM whatever WHERE datefield = NOW()
but I am a noob @ MySQL, and the above statement didn't work

Cheers Everyone willing 2 help :-)

coopster

6:12 pm on Nov 7, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



You only want the DATE portion of the timestamp for comparison.
SELECT * FROM whatever WHERE DATE(datefield) = CURDATE();