Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: date in select statement
The to_XXX functions convert datatypes. In your case what you want to do is
display a date type in a particular character format. therefore what you
want is
select to_char(validityfrom,'YYYYMMDDHH24MISS') fromuserrequest;
or you could issue
alter session set nls_date_format 'YYYYMMDDHH24MISS'; and then just
select validtydate from userrequest;
HTH
-- Niall Litchfield Oracle DBA Audit Commission UK ***************************************** Please include version and platform and SQL where applicable It makes life easier and increases the likelihood of a good answer ****************************************** P.S. I have temporarily mislaid my sql reference so the syntax for to_char and alter session will likely be slightly off. "Peace" <peace_at_japan.com> wrote in message news:277abc47.0202150132.5f819cdd_at_posting.google.com...Received on Fri Feb 15 2002 - 04:38:40 CST
> How can I use to_date function to display date column in a table. i.e
> I want to in select statement.
> ex:
>
> sql>select to_date(validityfrom ,'YYYYMMDDHH24MISS') from
> userrequest;
>
> where validityfrom is a column with data type as date in table
> userrequest.
>
> Thanx for suggestions.
![]() |
![]() |