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: to_char not returning 'day' value without leading zero

Re: to_char not returning 'day' value without leading zero

From: Jim Smith <jim_at_jimsmith.demon.co.uk>
Date: Fri, 7 Apr 2006 09:47:53 +0100
Message-ID: <ksWc5xh5ciNEFwkw@jimsmith.demon.co.uk>


In message <1144359149.810285.96730_at_i39g2000cwa.googlegroups.com>, Kevin Blount <kevin.blount_at_gmail.com> writes
>I have the following query, which returns dates, but those dates
>contain leading zeros for the DD part, even though I'm using the
>fill_mode FM, i.e. FMDD
>
>SELECT
> to_char(date_created,'FMMM/FMDD/YYYY') as date_joined,
>
>FROM
> user_table
>
>GROUP BY
> to_char(date_created,'FMMM/FMDD/YYYY')
>
>ORDER BY
> MIN(date_created) DESC"
>
>the results I get are like this: 3/08/2006
>
>this page: http://www.techonthenet.com/oracle/functions/to_char.php -
>tells me that adding FM before my date parts will remove the leading
>zero - and as you can above, the leading zero from the MM part is gone,
>but it's still there for the DD part.
>
>anyone know how to remove this? I could do a simple ASP replace truck,
>and looks for any "/0" and replace with "/", but that seems
>unncessary... but then again, it FMDD won't work....
>
>TIA for any help you can give
>

FM is a toggle. The first time you use it, it switches fill mode on, the second time, it switches it off. In general, you only need it once at the beginning of the format string.

-- 
Jim Smith
I'm afraid you've mistaken me for someone who gives a damn.
Received on Fri Apr 07 2006 - 03:47:53 CDT

Original text of this message

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