Datetype field conversion to YYMMDDHH24MISS

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jschoono
    New Member
    • Nov 2007
    • 3

    Datetype field conversion to YYMMDDHH24MISS

    Hi there,

    I need to convert a date type field into following format: yymmddhh24miss.

    Is there a similar function like TO_CHAR(table.d atefield,'YYMMD DHH24MISS') i use for the conversion on an oracle database?

    Thanks for your help,
    Cheers
  • numberwhun
    Recognized Expert Moderator Specialist
    • May 2007
    • 3467

    #2
    Originally posted by jschoono
    Hi there,

    I need to convert a date type field into following format: yymmddhh24miss.

    Is there a similar function like TO_CHAR(table.d atefield,'YYMMD DHH24MISS') i use for the conversion on an oracle database?

    Thanks for your help,
    Cheers
    That's nice, but you failed to mention the language that you are working in. We are not mind readers you know.


    Regards,

    Jeff

    Comment

    • jschoono
      New Member
      • Nov 2007
      • 3

      #3
      Originally posted by numberwhun
      That's nice, but you failed to mention the language that you are working in. We are not mind readers you know.


      Regards,

      Jeff
      Hi Jeff,

      That's the whole point. I need something generic that takes this in account ;-)

      Thanks for the reply,
      Jacques

      Comment

      • jschoono
        New Member
        • Nov 2007
        • 3

        #4
        Hi all,

        In the meanwhile i got a working solution, but should anyone have comments or a better solution, posting will be much appreciated :-) I am not sure if this is generic enough to be used in the various regions.

        CONVERT(varchar (6),<myDateTime field>,12)+REPL ACE(CONVERT(var char(12),<myDat eTimefield>,114 ),':','')

        Cheers,
        Jacques

        Comment

        • pbmods
          Recognized Expert Expert
          • Apr 2007
          • 5821

          #5
          Heya, Jschoono.

          Are you looking for DATE_FORMAT()?

          Comment

          Working...