Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2014
    Posts
    4

    Unanswered: current_date logic required

    Hello,


    My requirement is to identify any cases older than 60 days using a calculation on the disc_date field (current date minus disc_date) in the below table.
    disc_date is field in table

    I tried by using the below query
    select DAY(CURRENT_DATE - DISC_DATE)> 60 DAY as disc_date
    from SSN

    Not working


    Any help will appreciate.
    Last edited by sukh; 08-14-16 at 01:00.

  2. #2
    Join Date
    Apr 2012
    Posts
    1,034
    Provided Answers: 18
    Show the DDL of the table involved (to see the data type of the DISC_DATE column).
    Show your DB2-server version and operating system name (is it DB2 on Z/OS, on AIX, Linux/Unix/Windows) etc.
    Do not write "not working", instead write the exact error code.
    If the DISC_DATE column has data-type DATE, the syntax would be similar to SELECT whatever from SSN where DISC_DATE < CURRENT DATE - 60 DAYS

  3. #3
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    I believe you are looking for:

    Code:
    select ...
    where DISC_DATE < CURRENT DATE - 60 DAYS
    Andy

Posting Permissions

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