Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Use of to_date function
If your running your query from sqlplus you can set the nls date format as follows:
alter session set nls_date_format = 'DD-MON-YYY HH:MI:SS');
Any date comparisons will now use that format.
ECA
stamp.dean_at_corona.navy.mil wrote in article
<879869101.32112_at_dejanews.com>...
> Does anybody know if you can use the to_date function to select on both a
> date and time without typing in the format? For example, I want to do:
>
> select datetime from a.view where datetime = to_date('05-AUG-97
11:13:42')
>
> without having to type in the extra ,'DD-MON-YY HH:MI:SS'). I found out
> you don't have to type in the format portion when you just enter a date.
> For example, the following works:
>
> select datetime from a.view where datetime = to_date('05-AUG-97')
>
> but, of course, in this case you only get records occurring at time
> 00:00:00. Thanks for any help or if you can direct me where to go to get
> further information.
>
> -------------------==== Posted via Deja News ====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet
>
Received on Wed Nov 19 1997 - 00:00:00 CST
![]() |
![]() |