Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Please help with Conversion function in sql

Posted on 2009-12-18
7
Medium Priority
?
291 Views
Last Modified: 2013-12-18
Hello everyone

I need to convert date with format mm/dd/yyyy to numeric nnnn format

char to varchar

in oracle sql query

Please help


0
Comment
Question by:aruku
  • 3
  • 3
7 Comments
 
LVL 61

Expert Comment

by:HainKurt
ID: 26083359
select to_char(sysdate, 'fmYYYY') from dual

date does not have format, I mean datetime column in database...

can you please give example showing what are you tryin to do...
0
 
LVL 5

Expert Comment

by:felipevidaurri
ID: 26083410
You need convert Date to Numeric Format like Excel used?...
0
 

Author Comment

by:aruku
ID: 26083427
For example 12/23/2008 must be  as 2008

i need to convert the date fromat to numeric and use right function


i need to convert a char value to varchar
0
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

 

Author Comment

by:aruku
ID: 26083481
In the database the dob is for example given as 12/23/2003 then after writing the query i need to get only
2003. The dob in date datatype and i need to convert it to numeric. I need to write in oracle
0
 
LVL 61

Expert Comment

by:HainKurt
ID: 26083550
select to_number(to_char(sysdate, 'fmYYYY')) from dual
0
 
LVL 61

Accepted Solution

by:
HainKurt earned 2000 total points
ID: 26083556
sorry, you should use

select to_number(to_char(dob, 'fmYYYY')) from dual --> will give you number 2003
select to_char(dob, 'fmYYYY') from dual --> will give you char '2003'
0
 

Author Comment

by:aruku
ID: 26084119
Can you please tell me the same way how to convert Char datatype to Varchar2 and numeric to Varchar2
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I’ll look at how you can use a backup to start a secondary instance for MongoDB.
What we learned in Webroot's webinar on multi-vector protection.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

577 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question