Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2010
    Posts
    38

    Unanswered: Selecting and joining dates over interval

    Hi!

    I'm having trouble figuring out this one select query. I have the following tables:

    TblCapacity

    Code:
    colGrp	colDate 	colCapacity
    ===================================
    grp1	1/1/2012	8
    grp1	2/6/2012	16
    TblCalendar

    Code:
    colDate		colWorkDay
    ==========================
    2/1/2012	1
    2/2/2012	1
    2/3/2012	1
    2/4/2012	0
    2/5/2012	0
    2/6/2012	1
    2/7/2012	1
    ...
    I want to select every working day and the correct capacity. The capacity has a starting day and is used until there's a newer date. The result should look something like this:

    Code:
    colGrp	colDate		colCapacity
    ===================================
    grp1 	2/1/2012	8
    grp1 	2/2/2012	8
    grp1 	2/3/2012	8
    grp1 	2/6/2012	16
    grp1 	2/7/2012	16
    Thanks for any help!

  2. #2
    Join Date
    Feb 2010
    Posts
    38
    Oh, and the db is a Progress OpenEdge 10.1

Posting Permissions

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