Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

convert char to date in oracle

Posted on 2011-03-14
3
Medium Priority
?
748 Views
Last Modified: 2012-05-11
There is an old oracle audit table in oracle that has data for a date in varchar format
The value is stored as 01/20/2011 00:00
Now I want to take this column as date. The column name is old_value
Table is campaign_donors_audit.
0
Comment
Question by:anumoses
3 Comments
 
LVL 74

Accepted Solution

by:
sdstuber earned 1000 total points
ID: 35130237
select to_date(old_value,'mm/dd/yyyy hh24:mi') from campaign_donors_audit
0
 
LVL 78

Expert Comment

by:slightwv (䄆 Netminder)
ID: 35130238
just use to_date:

to_date(old_value,'MM/DD/YYYY HH24:MI')
0
 
LVL 4

Expert Comment

by:subratabiswas
ID: 35130264
select to_date('01/20/2011 00:00', 'mm-dd-rrrr HH24:MI') from dual for your example
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

916 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