I am trying to find out the most recent price changes on Materials. Here is what I have in the table
Material Valid From Date Valid To Date Price
123 01/01/2012 01/06/2012 10
123 01/07/2012 05/12/2013 20
123 06/12/2013 12/31/9999 30
As shown above, the Valid to date of the Last change is always set to 12/31/9999 which helps me get the price changed to (30 In this case). I am not sure how to the the price before last change (20 in this case).