Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2007
    Posts
    9

    Unanswered: converting varchar to date

    hi,

    I have a column which has varchar format but the content is date..
    and i want to convert that into date..

    pls help.

    eg.

    Date 1
    15/05/2006 15:45:45

    Date 2
    15/06/2006 15:45:45

    both the columns are in varchar format.. i need to convert it into date format.. i am not able to manipulate anything on these dates because of this format..

    Pls look into this..

  2. #2
    Join Date
    Nov 2002
    Posts
    272
    What you need is the TO_DATE() function.

  3. #3
    Join Date
    Feb 2007
    Location
    Bratislava, Slovakia
    Posts
    85
    regards for programmer which date store in varchars

  4. #4
    Join Date
    Feb 2007
    Location
    Bratislava, Slovakia
    Posts
    85
    when you need change datatype try this:
    -alter table my_table add col_dT1 date
    - update my_table set dol_dt1=to_DATE(orig_col1, 'dd/mm/yyyy hh24:mi:ss')
    - drop orig_col1
    rename col_dt1 to original name

  5. #5
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Right; only, not all Oracle versions support column renaming.

  6. #6
    Join Date
    Apr 2007
    Posts
    9

    thanks

    thanks for all the valuable suggestions..

    working..

Posting Permissions

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