Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: date in select statement

Re: date in select statement

From: Niall Litchfield <n-litchfield_at_audit-commission.gov.uk>
Date: Fri, 15 Feb 2002 10:38:40 -0000
Message-ID: <3c6ce535$0$8506$ed9e5944@reading.news.pipex.net>


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...

> 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.
Received on Fri Feb 15 2002 - 04:38:40 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US