"Peter M. Perchansky" <[EMAIL PROTECTED]> wrote:
> I'm using the datetime format and the data is stored in mySQL as
CCYY-MM-DD
> HH:MM:SS
>
> I want to use a SELECT statement where the ORDER BY clause is based on the
> date portion (CCYY-MM-DD).
>
> How would I write the clause to ignore the time portion?

See the manual - there are a few dozen built-in date functions.  For
starters try:

DATE_FORMAT( my_date, "%Y%m%d" )
TO_DAYS( my_date ) // only for dates after year 1600 or so, won't give in
desired format, but might be faster.

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to