Posts Topics Forums Images
Search videos from message boards Videos Search messages from microblogs Microblogs Search messages from imdb.com Imdb Search messages from yuku.com Yuku Search messages from lefora.com (free forums) Lefora
My account: Login | Sign Up
Loading... 

Thread: Converting Varchar2 to Date getting prob

Started 1 month, 1 week ago by user10647455
Hello Guys Actually my column contains date in following format dd/mm/yyyy I am trying this query to update it into something like dd/mm/yyyy HH24:MM:SI when i am using SELECT statment it worked fine but when i update the column it's saying not a valid month Please look at the querys select to_Char(to_date(create_date, 'mm/dd/yy HH24:MI:SS' ), ...
Site: www.oracle.com  www.oracle.com - site profile
Forum: SQL and PL/SQL   SQL and PL/SQL
 - forum profile
Total authors: 6 authors
Total thread posts: 12 posts
Thread activity: no new posts during last week
Domain info for: oracle.com

Other posts in this thread:

Frank Kulash replied 1 month, 1 week ago
Hi, Apparantly you have some bad data. See this thread for help in finding it. I load_date a string also? If so, you should use TO_DATE in the WHERE clause, also. Dates belong in DATE columns. Once you find and correct (or remove) all the bad data, you should add a DATE column (or two, depending on load_date) and remove the old VARCHAR2 column(s...

Massimo Ruocchio replied 1 month, 1 week ago
If create_date is already in mm/dd/yyyy format (as you're writing) the update is changing to value to itself... SVIL>select to_Char(to_date( '09/16/2009' , 'mm/dd/yy HH24:MI:SS' ), 'mm/dd/yyyy' ) 2 from dual; TO_CHAR(TO ---------- 09/16/2009 Max

Boneist replied 1 month, 1 week ago
user10647455 wrote: Hello Guys Actually my column contains date in following format dd/mm/yyyy Please look at the querys select to_Char(to_date(create_date, 'mm/dd/yy HH24:MI:SS' ), 'mm/dd/yyyy HH24:MI:SS' ) from Report where trunc(Load_Date) = trunc(sysdate - 52) --WorkingFine --but this one not its getting updated no issue in update ...

Centinul replied 1 month, 1 week ago
Frank -- I can't view the link you posted. I think it has an extra "?" at the end. Thanks!

Boneist replied 1 month, 1 week ago
It should be: this thread

user10647455 replied 1 month, 1 week ago
thanks for replies guys but i have data in column in various formates some has timestap like including HH24MISS and some has only mm/dd/yyyy so tats y i need to convert so wat could be possible way to do that please suggest and yea you guys true i have bad data in table but need to convert into date by anyhow soo please help in case of when i have ...

Frank Kulash replied 1 month, 1 week ago
Hi, Centinul wrote: Frank -- I can't view the link you posted. I think it has an extra "?" at the end. Thanks for pointing that out; it's fixed now. This site sometimes strips off the last number from the URL, the part that iedentifies the exact message within the thread. When that happens, you can always remove the non-digits from the end of ...

Lakmal Rajapakse replied 1 month, 1 week ago
I am just wondering, what is the datatype of create_date? I suspect you are trying to convert a date field into a character and then use that to update a date field - which will do an implicit conversion and fail because the date format you have does not match with the default nls_date_format. that is the only reason I can see how the following will work:...

Massimo Ruocchio replied 1 month, 1 week ago
If you want this format (mm/dd/yyyy HH24.MI:SS) after updating the table, your update must be: Update Report Set Create_date = to_Char(to_date(Create_date, 'mm/dd/yy HH24:MI:SS' ), 'mm/dd/yyyy hh24:mi:ss' ) where trunc(Load_Date) = trunc(sysdate - 52) Max

Centinul replied 1 month, 1 week ago
Frank Kulash wrote: This site sometimes strips off the last number from the URL, the part that iedentifies the exact message within the thread. When that happens, you can always remove the non-digits from the end of the URL, as Boneist did, and read the whole thread. Frank -- Thanks. I understand and that's what I did. I just wanted to point ...

 

Top contributing authors

Name
Posts
user10647455
3
user's latest post:
Converting Varchar2 to Date...
Published (2009-11-09 13:10:00)
Thanks A Lot it worked
Massimo Ruocchio
2
user's latest post:
Converting Varchar2 to Date...
Published (2009-11-09 09:47:00)
If you want this format (mm/dd/yyyy HH24.MI:SS) after updating the table, your update must be: Update Report Set Create_date = to_Char(to_date(Create_date, 'mm/dd/yy HH24:MI:SS' ), 'mm/dd/yyyy hh24:mi:ss' ) where trunc(Load_Date) = trunc(sysdate - 52) Max
Frank Kulash
2
user's latest post:
Converting Varchar2 to Date...
Published (2009-11-09 09:37:00)
Hi, Centinul wrote: Frank -- I can't view the link you posted. I think it has an extra "?" at the end. Thanks for pointing that out; it's fixed now. This site sometimes strips off the last number from the URL, the part that iedentifies the exact message within the thread. When that happens, you can always remove the non-digits from the end of the URL, as Boneist did, and read the whole thread.
Boneist
2
user's latest post:
Converting Varchar2 to Date...
Published (2009-11-09 09:21:00)
It should be: this thread
Centinul
2
user's latest post:
Converting Varchar2 to Date...
Published (2009-11-09 09:54:00)
Frank Kulash wrote: This site sometimes strips off the last number from the URL, the part that iedentifies the exact message within the thread. When that happens, you can always remove the non-digits from the end of the URL, as Boneist did, and read the whole thread. Frank -- Thanks. I understand and that's what I did. I just wanted to point it out to those folks that didn't know that didn't get confused.
Lakmal Rajapakse
1
user's latest post:
Converting Varchar2 to Date...
Published (2009-11-09 09:40:00)
I am just wondering, what is the datatype of create_date? I suspect you are trying to convert a date field into a character and then use that to update a date field - which will do an implicit conversion and fail because the date format you have does not match with the default nls_date_format. that is the only reason I can see how the following will work: select to_Char(to_date(create_date, 'mm/dd/yy HH24:MI:SS' ), 'mm/dd/yyyy...

Related threads on "www.oracle.com":

Related threads on other sites:

Thread profile page for "Converting Varchar2 to Date getting prob" on http://www.oracle.com. This report page is a snippet summary view from a single thread "Converting Varchar2 to Date getting prob", located on the Message Board at http://www.oracle.com. This thread profile page shows the thread statistics for: Total Authors, Total Thread Posts, and Thread Activity