Topic: SQL*Plus and PL/SQL >> converting a value to Oracle default date format
|
Disclaimer: The purpose of all dbapool forums including OCP and Other Oracle Certification forums is to help each other with specific issues but not to share dump and copyrighted exam content, materials or intellectual property.
You may review the entire Oracle Certification Program Candidate Agreement online Here.
|
|
|
|
| Title: converting a value to Oracle default date format |
| Burton |
Posted: Mar 14, 2007 05:07:16 PM |
Total Post: 53
Joined: Dec, 2006
|
Hello Friends:
Have this question, not sure how to do it. Any experts out there?
If you have a date, Jan. 1, 1999, how can you convert it to the oracle default format?
I am trying it this way:
select to_date ('Jan 11 999', 'DD-MON-YYYY')
FROM DUAL;
But I am failing. Please advise !
Thanks.
B |
|
|
Burton |
| Posted: Mar 14, 2007 08:58:29 PM | |
|
Total Post: 53
Joined: Dec, 2006
|
Select to_char (01/01/1999, 'MM/DD/YYYY')
from dual;
Is the way I am doing it now....
One other thing:
This is a question in a long list of questions. I have answered them all but I am having a problem just understanding the meaning of this:
In To_char(’02-JAN-03’,’DD/MM/YYY’) and to_date(‘02/02/2003’,’DD/MM/YYYY’), what the format masks, ‘DD/MM/YYYY’ does for these functions differently in terms of formatting input and/or output?
Any bright lights out there?
B
|
|
|
|
|
Rush |
| Posted: Mar 15, 2007 01:11:02 AM | |
|
Total Post: 127
Joined: Jan, 2007
|
Hello Burton
try this
select to_date('19,11,81','dd-mon-yy')from dual;
*plz don't give 'dd-mon-yy' dd-mm-yy will autometicaly convert this in default formate.and plz note 'dd-mm-yy' abd 'dd,mm,yy' both will work here
in this situation for default formate
RUPESH
|
|
|
|
|
Rush |
| Posted: Mar 15, 2007 01:12:51 AM | |
|
Total Post: 127
Joined: Jan, 2007
|
sorry burton,
solution is this
select to_date('19,11,81','dd-mm-yy')from dual;
avoid previous one
RUPESH
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |
|
|
|
|
Forum Rules & Description
Who Can Read The Forum? Any registered user or guest
Who Can Post New Topics? Any registered user
Who Can Post Replies? Any registered user
|
| |
Get FREE Magazines
|
Top 10 Forum User
|
| Murtuja Khokhar | 857 |
| Mohammed Taj | 746 |
| positive fanatic | 483 |
| Jayanta Sur | 479 |
| Vigyan Kaushik | 386 |
| Vinoth Kumar | 357 |
| Gopu Gopi | 340 |
| Gitesh Trivedi | 322 |
| neeraj sharma | 258 |
| Ramesh Jois | 246 |
|
|