Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL*Plus display format question
wrapping the expression in a SUBSTR function will also work: e.g.
SUBSTR( to_char(sysdate,'mm/dd/yyyy hh24:mi:ss') ,1,19)
note: the 'hh' format will return the hour as 01 thru 12, so you may want to consider returning the hour in 24-hour format as 00 thru 23 ('hh24'), or include the am/pm string.
HTH
"David Fitzjarrell" <oratune_at_aol.com> wrote in message
news:94sd30$2ns$1_at_nnrp1.deja.com...
> In our last gripping episode wax_man_at_my-deja.com wrote:
> > I'm having a problem with the SQL*Plus display of to_char queries and
> > am looking for some help. If I run select to_char
(sysdate,'mm/dd/yyyy
> > hh:mi:ss') as "date" from dual, I get the following as the responce:
> >
> > date
> > ----------------------------------------------------------------------
--
> > ---
> > 01/26/2001 12:24:39
> >
> > Does anyone know how to get the date to print w/o all of the extra
> > spaces/dashes? The date is displayed this way wether it is by itself,
> > or in the middle of a big select clause.
> >
> > Thanks for any help,
> >
> > wax_man
> >
> > Sent via Deja.com
> > http://www.deja.com/
> >
>
>
> >
![]() |
![]() |