Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2003
    Posts
    14

    Unanswered: conversion from string to timestamp

    Hi all,

    I'm using DB2 UDB v8.1 on solaris. I am currently writing a stored procedure. In the procedure, I need to convert a string into timestamp.

    The string format will be of MM/DD/YYYY.

    However, the timestamp_format in DB2 is only valid for 'YYYY-MM-DD HH24:MIS'. How can I convert the date to timestamp in DB2?

    Many thx.

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5

    Re: conversion from string to timestamp

    Assuming you want the time portion of the timestamp to be midnight:

    TIMESTAMP(myDateString,'00:00:00')

    HTH

    Andy

    Originally posted by db2worker
    Hi all,

    I'm using DB2 UDB v8.1 on solaris. I am currently writing a stored procedure. In the procedure, I need to convert a string into timestamp.

    The string format will be of MM/DD/YYYY.

    However, the timestamp_format in DB2 is only valid for 'YYYY-MM-DD HH24:MIS'. How can I convert the date to timestamp in DB2?

    Many thx.

Posting Permissions

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