Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL COMMAND
Dominique PREVOT wrote:
> Hi,
> Does anyone know if there is a SQL command that convert a date-time
> value to a date value ?
>
> For instance,
>
> select * from table where (TO_DATE(CreationDate) < 2002/12/01);
>
> (where CreationDate is a date-time field (yyyy/mm/dd:hh:mm:ss:lll))
>
> Thanks for help,
> Dominique
All dates in Oracle contain the time. There is no alternative.
If you want to display only the date use TO_CHAR(datevalue, 'YYYY/MM/DD') If you want to make all date-times for the same calendar day comparable:
TRUNC(datevalue)
which converts the hours, minutes, and seconds to 00:00:00
Daniel Morgan
http://www.outreach.washington.edu/extinfo/certprog/oad/oad_crs.asp
Received on Tue Dec 17 2002 - 11:35:55 CST