Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2004
    Location
    India
    Posts
    23

    Exclamation Unanswered: Conversion of text field to timestamp

    Hi all....
    Can I convert text field which contains date in text format (something like '03011954')
    to timestamp or date datatype in DB2 UDB (v 8.1) ???
    I can use separate column of timestamp datatype which will be updated with the data in text datatype column.

    Thanks in advance,
    Madhuri.

  2. #2
    Join Date
    Jan 2003
    Location
    Zutphen,Netherlands
    Posts
    256
    I think format should be : 'yyyy-mm-dd'

    So, something like:

    DATE(SUBSTR(FIELD,5,4)||'-'||SUBSTR(FIELD,3,2)||'-'||SUBSTR(FIELD,1,2))
    Ties Blom
    Senior Application Developer BI
    Getronics Healthcare
    DB2,ORACLE,Powercenter,BusObj,Access,
    SQL, SQL server

Posting Permissions

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