-
I have a table with a column TSTAMP. This column is varchar2(50) and gotten from a log file. A sample row from this column is as follows :
TSTAMP
---------------------------------------------------
03/22/01 07:27:15.0997
Note that after seconds, we have 4 places of mili seconds. Iam trying to convert the whole thing into date format, but does not work !!
select TO_date(tstamp,'mm/dd/yy hh:mi:ss.ssss') from log_details;
Error returned is :
ORA-01810: format code appears twice
Any ideas?????
-
select TO_date(substr(tstamp, 1, 17) ,'mm/dd/yy hh:mi:ss') from log_details
-
No, that does not work, since I need the output to include the milliseconds, besides your query prints only the date!!!
-
As far as I know, you cannot store millisecs in oracle. BTW, jdorlon's query is correct and its printing the date object.
If you want the complete info printed,
you can modify his query to do a to_char(TO_date(substr(tstamp, 1, 17) ,'mm/dd/yy hh:mi:ss') , 'dd-mon-yyyy hh24:mi:ss')
let me know if you have any questions
uday
-
Thanks a tonne !!!! guys...that will help....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|