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

to_char not returning 'day' value without leading zero

From: Kevin Blount <kevin.blount_at_gmail.com>
Date: 6 Apr 2006 14:32:29 -0700
Message-ID: <1144359149.810285.96730@i39g2000cwa.googlegroups.com>


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 Received on Thu Apr 06 2006 - 16:32:29 CDT

Original text of this message

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