Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Need help with removing leading 0 from date

user521525Aug 20 2013 — edited Aug 21 2013

Need to query database where date is stored in varchar2 field as: Aug 2, 2013  or Aug 19, 2013.

Following is my query:

select to_char(sysdate -1, 'Mon dd, yyyy%') from dual;

returns Aug 19, 2013%

select to_char(sysdate -15, 'Mon dd, yyyy%') from dual;

returns Aug 05, 2013%

I would like output Aug 5, 2013% without leading zero for day of the month for Aug 1 thro Aug 9.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 18 2013
Added on Aug 20 2013
6 comments
1,357 views