Re: How is date storeed in column?

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: 2000/06/30
Message-ID: <395C555F.594A_at_yahoo.com>#1/1


Newbie (Joe ) wrote:
>
> Can sorting be done when stored as a char variable?
>
> "Sybrand Bakker" <postbus_at_sybrandb.demon.nl> wrote in message
> news:962297073.4119.4.pluto.d4ee154e_at_news.demon.nl...
> > Use to_char(column_name, 'dd-mm-yyyy hh24:mi:ss')
> > etc.
> >
> > Hth,
> >
> > Sybrand Bakker, Oracle DBA
> >
> > "Beginner" <NOSPAM_at_hotmail.com> wrote in message
> > news:OlJ65.167$Hs3.3966_at_news1.mts.net...
> > > Randy, thanks for your help...
> > > What I need to know though, is how can I retrieve the time value of a
 date
> > > entered into the database?
> > > ie: A user makes an entry, I want to track the time it was placed.
> > > Currently it's entering SYSDATE in that field, but when I do a select,
 it
> > > shows only DD-MON-YY. Does it store the time as well? IF so, how can I
> > > retrieve it, if not, how can I do so?
> > > Thanks!
> > >
> > > "Randy DeWoolfson" <randy_at_euclidsys.com> wrote in message
> > > news:395B5EE4.DFCC375D_at_euclidsys.com...
> > > > use the TO_DATE function
> > > > e.g.
> > > >
> > > > TO_DATE('dd-mon-yy hh24:mi:ss', '01-Mar-67 14:35:22')
> > > >
> > > > (Notice minutes are mi not mm )
> > > >
> > > > randy
> > > >
> > > > Beginner wrote:
> > > >
> > > > > When a field is declared as a 'date' type, what format is it? Can
 it
 be
> > > > > stored as 'dd-mon-yy hh:mm:ss am'?
> > > > > I have a date field that says too many precision specifiers when I
 truncate
> > > > > it this way...Do I have to store this as a string?
> > > >
> > >
> > >
> >
> >

Yes - but if its a char then you need to to_date it..

select blah
from blah
order by to_date(char_col_which_is_a_date)

HTH

-- 
===========================================
Connor McDonald
http://www.oracledba.co.uk

We are born naked, wet and hungry...then things get worse
Received on Fri Jun 30 2000 - 00:00:00 CEST

Original text of this message