Welcome Guest ( Log In | Register )


 
 
 
 
 
 

 
 
Oracle 

Performance Tuning Reference poster
 
Oracle training in Linux 

commands
 
Oracle training Weblogic Book
 
Easy Oracle Jumpstart
 
Oracle training & performance tuning books
 
Burleson Consulting Remote DB Administration
 
 
 
Reply to this topicStart new topic
> to_char function, I want to extract emp joining date as mm/dd/yy format using to_char
thiyagusham
post Mar 26 2012, 06:25 AM
Post #1


Advanced Member
***

Group: Members
Posts: 78
Joined: 16-March 12
From: Chennai from India
Member No.: 46,939



my table having doj 30-jan-2003


SQL> select to_char(date_of_joining,'yyyy') from t1;
select to_char(date_of_joining,'yyyy') from t1
*

ERROR at line 1:
ORA-01722: invalid number
Go to the top of the page
 
+Quote Post
Munchun Singh
post Mar 26 2012, 06:52 AM
Post #2


Newbie
*

Group: Members
Posts: 5
Joined: 5-March 12
Member No.: 46,875



Hi,

First date_of_joining convert to TO_Date then use TO_CHAR

SELECT TO_CHAR(TO_DATE(DATE_OF_JOINING),'YYYY') FROM T1;



--
Neeraj Kumar Singh
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 20th October 2014 - 04:07 PM