Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2012
    Location
    Arizona
    Posts
    9
    Provided Answers: 1

    Answered: Filter Date Results Between Current and Future Date

    I'm trying to create a filter in a DB2 query, that only pulls in date values that fall within a range between Current Date and 90 Days into the future.

    For Example, I currently use the following CASE Statement filter to find dates that fall within a range between Current Date and 90 Days in the PAST

    Code:
    CASE WHEN Ca_Add_Promo_File.Date_Add
    BETWEEN 
    DATE('0001-01-01') + YEAR(CURRENT_DATE) 
    YEARS - 1 YEAR + 
    MONTH(CURRENT_DATE) MONTHS - 4 MONTHS
    AND
    CURRENT_DATE - DAY(CURRENT_DATE) DAYS 
    THEN 1
    ELSE 0
    END
    But I now want to filter in dates that are between Current Date and 90 Days into the FUTURE

  2. Best Answer
    Posted by dash11

    "Easy enough. That appears to have done the trick, thank you!"


  3. #2
    Join Date
    Apr 2008
    Location
    Iasi, Romania
    Posts
    579
    Provided Answers: 3
    Ca_Add_Promo_File.Date_Add BETWEEN CURRENT_DATE AND CURRENT_DATE + 90 DAYS
    Florin Aparaschivei
    DB2 9.7, 10.5 on Windows
    Iasi, Romania

  4. #3
    Join Date
    Jul 2012
    Location
    Arizona
    Posts
    9
    Provided Answers: 1
    Easy enough. That appears to have done the trick, thank you!

Tags for this Thread

Posting Permissions

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