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

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL column formating

Re: SQL column formating

From: DA Morgan <damorgan_at_psoug.org>
Date: Tue, 19 Sep 2006 14:11:42 -0700
Message-ID: <1158700300.508711@bubbleator.drizzle.com>


chuaby_at_hotmail.com wrote:

>> What version of Oracle and can you show us a sample of the data?

>
>
> I am using Oracle 8i. My data is stored as string.
>
> eg
>
> Start Date
> =========
> 01-Jan-2001
> Jan-2001
> 2001
>
>
> right justified. But currently, i am using lpad to push the data to the
> left to become
>
> Start Date
> =========
> 01-Jan-2001
> Jan-2001
> 2001
>
> so that it is easier to read.
>
> So, i have a problem of formating it without using lpad. But by using
> lpad, the oracle gives the error "sort not in order" which requires me
> to remove some function.
>
> so, i am trying to look for a cleaner formating solution. Thank you in
> advance for any advice.
>
> Best Regards
> Boon Yiang

It is hard to tell from this what will solve your problem but my instinct would be to use DECODE to alter the incomplete information so that it appears complete and then use TO_DATE to cast the final value as a date for display.

-- 
Puget Sound Oracle Users Group
Received on Tue Sep 19 2006 - 16:11:42 CDT

Original text of this message

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