MySQL Forums
Forum List  »  Newbie

Re: Select rows from date not time in where clause
Posted by: Felix Geerinckx
Date: June 16, 2005 05:32AM

Tom Whitbread wrote:

> I am trying to select all the rows that where entered today and I have a
> datetime type column to store the date data in.
> How can I specify in my where clause to select where datecol=today and not have to specify the
> time?

SELECT * FROM foo WHERE
datecol >= CURDATE() AND datecol < CURDATE() + INTERVAL 1 DAY;

--
felix
Please use BBCode to format your messages in this forum.

Options: ReplyQuote


Subject
Written By
Posted
Re: Select rows from date not time in where clause
June 16, 2005 05:32AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.