Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2012
    Posts
    1

    Unanswered: return array of dates between two different dates

    Hello All,

    I am trying to write a function that returns list of all the dates between two dates. i am trying to use table function but i am not getting clear idea, i am new to db2, can anyone help regarding this.

    Thanks
    Venkat

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Code:
    with t1 (adate) as (values (start_date) union all select adate + 1 day from t1 where adate < end_date) select * from t1
    Something like this should work.

    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
  •