converting Date to Date or Char

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nikos
    New Member
    • Mar 2008
    • 4

    converting Date to Date or Char

    Hi,
    I have a table with one of the columns configured to record dates as ('#', 'MM/DD/YYYY'). However, two entries in that column are of format YYYY and MM/YYYY. How can I change only those two entries preferably to Date but in formats above?
    i tried to do:
    [code=oracle]

    "update table_name
    set column_name = to_date('2008', 'YYYY')
    where c_id = 12"
    [/code]

    but it records the date in format MM/DD/YYYY with values 03/01/2008 (i dont know how it selects this specific date).
    If it is not possible to change the date format of the column without affecting the whole column, how can I change my two specific formats to strings?
    Thank you for help.
    Last edited by amitpatel66; Mar 17 '08, 07:47 AM. Reason: code tags
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    How is it possible that only 2 values are stored in different format ?

    Comment

    • amitpatel66
      Recognized Expert Top Contributor
      • Mar 2007
      • 2358

      #3
      You mean you want to update the two records to the formats of YYYY and MM/YYYY respectively?

      Comment

      • nikos
        New Member
        • Mar 2008
        • 4

        #4
        Originally posted by debasisdas
        How is it possible that only 2 values are stored in different format ?
        The original table is from excel, so in excel there were those dates (year, and month and year) to indicate a start of event.

        Comment

        • nikos
          New Member
          • Mar 2008
          • 4

          #5
          Originally posted by amitpatel66
          You mean you want to update the two records to the formats of YYYY and MM/YYYY respectively?
          yeah, i basically need to select the year of 2003 and insert it into DATE configured column as 2003 without month or day. Another possibility would be to insert it as a string, but i would need to convert those two entries only (ie, YYYY and MM/YYYY)

          Comment

          Working...