0 Replies Latest reply: Nov 15, 2012 8:55 AM by Cristian Ivanoff RSS

    Interval match question by a novice..

    Cristian Ivanoff

      Hello all,

       

      I have two tables:

       

      Table1

      %Key_Model, Number, Model, FromDate, ToDate
      1,123456, Model1, 2012-01-01, 2012-01-31
      2, 123456, Model2, 2012-02-01, 2012-04-30
      3, 123654, Model3, 2012-03-01, 2012-12-31
      

      ... and so on

       

      Table2

      Number, Date, Fact
      123456, 2012-01-01, 1
      123456, 2012-02-10, 1
      123654, 2012-02-11, 5
      

      ...and so on..

       

      I would like to create a table like this.

      Resulting table:

      %Key_Model, Number,Date, Fact
      1,123456, 2012-01-01, 1
      2, 123456, 2012-02-10, 1
      3, 123654, 2012-02-11, 5
      

       

      I want my resulting table to contain the %Key_Model from table1 but only where the event from table2 is between the dates in table1.

       

      Do you have any suggestions?

       

      Br

      cristian