Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2013
    Posts
    4

    Unanswered: Null in date field

    HI,

    I have column "RENEWAL_DATE" AS VARChar (8) and getting null also .i want to convert it into Date datatype in DB2.

    i tried

    ISNULL(HP_DTL_RENEWAL_DATE,' ')as renewal_date

    but not working .Can i get the right syntax for this.

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    I'd start with:
    Code:
    Cast(HP_DTL_RENEWAL_DATE AS DATETIME) AS renewal_date
    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  3. #3
    Join Date
    Apr 2008
    Location
    Iasi, Romania
    Posts
    561
    Provided Answers: 2
    Also take a look at COALESCE - DB2's ISNULL
    Florin Aparaschivei
    DB2 9.7, 10.5 on Windows
    Iasi, Romania

Posting Permissions

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