Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2013
    Posts
    3

    Unanswered: Timestamp to Varchar data conversion

    I am new to DB2. I have one column with datatype as timestamp in DB2.
    How can i convert datatype timestamp to varchar in select statement

    I have googled it and tried 2-3 methods to convert it into varchar but not succeeded.

    Waiting for your reply.

  2. #2
    Join Date
    Apr 2012
    Posts
    1,034
    Provided Answers: 18
    Have you tried studing the documentation on-line for your version of db2 and platform?

    There's more than one way...one way is:
    TO_CHAR - IBM DB2 9.7 for Linux, UNIX, and Windows

  3. #3
    Join Date
    Jul 2013
    Location
    Moscow, Russia
    Posts
    666
    Provided Answers: 55
    Have you tried:
    char(your_timestamp) or varchar(your_timestamp)
    ?

    If you want formatted output, try this:
    VARCHAR_FORMAT
    Regards,
    Mark.

Posting Permissions

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