?
Solved

Oracle Date format

Posted on 2014-02-14
3
Medium Priority
?
530 Views
Last Modified: 2014-02-26
Hi,
I have a varchar2 field that captures a values for dates like 17/01/2014 09:24. I wanted to convert this char value to a date format like mm/dd/yyyy without time stamp. I tried using to_date(charfield,'mm/dd/yyyy') but it is giving me a "not a valid month" error. Please help.
0
Comment
Question by:baralp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
3 Comments
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 2000 total points
ID: 39859993
regexp_substr(mycolumn,'^[^ ]+)

or
trunc(to_date('17/01/2014 09:24','DD/MM/YYYY HH24:MI')
0
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 39860046
To be safe on the second one depending on how your default date format is:

to_char(to_date('17/01/2014 09:24','DD/MM/YYYY HH24:MI'),'DD/MM/YYYY')

>>'mm/dd/yyyy') but it is giving me a "not a valid mon

It appears your data isn't in mm/dd/yyy format but dd/mm/yyyy format.
0
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 39860083
I should also point out that since your input data appears to be in dd/mm/yyyyy format, are you sure you want to convert it to "mm/dd/yyyy"

If you do, just change the format.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
Suggested Courses

752 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