Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Posts
    205

    Unanswered: Urgent Plz. Related to DATE datatype

    I have a query like this.

    select CHAR(DATE(CASE ae.EXEMPTIONGRANTEDDATE WHEN '' THEN ae.EXEMPTIONDENIEDDATE ELSE ae.EXEMPTIONGRANTEDDATE END), USA) from testdate


    Here, WHEN '' - This null value is not accepted by date format in DB2. How to handle this here. i.e if ae.EXEMPTIONGRANTEDDATE is null I have to take the value ae.EXEMPTIONDENIEDDATE in CASE.

    Plz reply as soon as possible.

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    COALESCE(ae.EXEMPTIONGRANTEDDATE, ae.EXEMPTIONDENIEDDATE)

    returns the first non-null value in the series.

    VALUE is a synonym for COALESCE.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

Posting Permissions

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