Home » SQL & PL/SQL » SQL & PL/SQL » convert 10142 to YYYYMMDD format
convert 10142 to YYYYMMDD format [message #459649] Mon, 07 June 2010 14:33 Go to next message
rahul_bahulekar
Messages: 18
Registered: January 2007
Junior Member
Hi,

I am having one table in which for currentdate column is having below values

10142
10143
10144
10145
10146
10147
10148

These values represents the date.

Ex 10146 = 146th day of 2010
10147= 147th day of 2010

I want to convert values in currentdate column in yyyymmdd format.

Do we have any inbuilt oracle function for this. please help.

Thankx
Re: convert 10142 to YYYYMMDD format [message #459650 is a reply to message #459649] Mon, 07 June 2010 14:37 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>Do we have any inbuilt oracle function for this. please help.
TO_DATE()
TO_CHAR()
SUBSTR()

It would be helpful if you followed Posting Guidelines - http://www.orafaq.com/forum/t/88153/0/

[Updated on: Mon, 07 June 2010 14:38]

Report message to a moderator

Re: convert 10142 to YYYYMMDD format [message #459651 is a reply to message #459649] Mon, 07 June 2010 14:40 Go to previous messageGo to next message
Solomon Yakobson
Messages: 3305
Registered: January 2010
Location: Connecticut, USA
Senior Member
rahul_bahulekar wrote on Mon, 07 June 2010 15:33
Do we have any inbuilt oracle function for this. please help.


TO_DATE is all you need.

SY.
Re: convert 10142 to YYYYMMDD format [message #459652 is a reply to message #459649] Mon, 07 June 2010 14:40 Go to previous message
Michel Cadot
Messages: 68767
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
SQL> select to_char(to_date('10142','YYDDD'),'DD/MM/YYYY') from dual;
TO_CHAR(TO
----------
22/05/2010

All functions in Database SQL Reference.

Regards
Michel

[Updated on: Mon, 07 June 2010 14:41]

Report message to a moderator

Previous Topic: Oracle DateTime
Next Topic: Analytical Function
Goto Forum:
  


Current Time: Sun Aug 24 23:22:05 CDT 2025