URGENT need help on date conversion
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: URGENT need help on date conversion

  1. #1
    Join Date
    May 2001
    Posts
    17

    Lightbulb

    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?????
    Share on Google+

  2. #2
    Join Date
    Nov 2000
    Posts
    344
    select TO_date(substr(tstamp, 1, 17) ,'mm/dd/yy hh:mi:ss') from log_details
    Share on Google+

  3. #3
    Join Date
    May 2001
    Posts
    17
    No, that does not work, since I need the output to include the milliseconds, besides your query prints only the date!!!
    Share on Google+

  4. #4
    Join Date
    Feb 2001
    Posts
    176
    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
    Share on Google+

  5. #5
    Join Date
    May 2001
    Posts
    17
    Thanks a tonne !!!! guys...that will help....
    Share on Google+

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width