Conversion of date format

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Abkumsingh13
    New Member
    • Jun 2007
    • 2

    Conversion of date format

    Hi,

    i need to convert a date into another date format but when i use TO_CHAR or TO_DATE key word to convert the date format the error given is:-
    Error starting at line 1 in command:
    update ln_si_addr_ex_s upport set trans_date = to_date('03:50: 53 11 Jun 2007','YYYY-mm-DD HH24:MI:SS')
    Error report:
    SQL Error: ORA-01843: not a valid month
    01843. 00000 - "not a valid month"
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    u only need to use the conversion functions properly with correct format.

    next time post what u tried to solve this.

    Comment

    • Abkumsingh13
      New Member
      • Jun 2007
      • 2

      #3
      Hi,
      I need to convert one date format to another. I am using the following query but is not working, can someone suggest the reson for the query not to work.

      select TO_CHAR(trans_d ate,'YYYY-MM-DD HH24:MI:SS') as trans_date from ln_si_addr_ex_s upport

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        since i dont have the table ,i tried on my local emp table .

        Its working fine

        1* select TO_CHAR(hiredat e,'YYYY-MM-DD HH24:MI:SS') as trans_date from emp
        SQL> /

        TRANS_DATE
        -------------------
        2002-01-01 03:45:45
        1981-11-17 00:00:00
        1981-05-01 00:00:00


        r u storing date in the table in any other format

        please specify.

        Comment

        • hellboss
          New Member
          • Jun 2007
          • 50

          #5
          Hi ! i need to concat three variable which contains the date,month and year respectively, then convert these string data into a Sql format date datatype,ie 103 format !
          Kindly help me !

          Comment

          • debasisdas
            Recognized Expert Expert
            • Dec 2006
            • 8119

            #6
            Originally posted by hellboss
            Hi ! i need to concat three variable which contains the date,month and year respectively, then convert these string data into a Sql format date datatype,ie 103 format !
            Kindly help me !
            can you kindly post your sample code for my reference please.

            Comment

            Working...