2 Replies Latest reply: Feb 5, 2012 2:38 PM by Przemysław Wojda RSS

    Join transactions with currency rates

    Przemysław Wojda

      Hi All,

       

      I got two tables - one stores transactions (TransNo, TransDate), the other stores currency rates (CurrRate, CurrDate). The tables need to be joined by date in a way that TransDate joins first previous CurrDate - as per the below example. Any idea how to join them?

       

      Transactions:

      TransNo, TransDate

      1, 2012-02-03

      2, 2012-02-06

       

      CurrencyRates:

      CurrDate, CurrRate

      2012-02-01 , 2.2

      2012-02-02 , 2.3

      2012-02-03, 2.5

      2012-02-06, 2.4

       

      JoinedTables:

      TransNo, TransDate, CurrDate, CurrRate

      1, 2012-02-03, 2012-02-02 , 2.3

      2, 2012-02-06, 2012-02-03, 2.5

       

       

      Regards,

      Przemek