I cant find out next
I have a table like this
Product from till price
1 2007-01-01 2008-12-31 10
1 2008-01-01 2009-12-31 11
In a query I want to match this
Product date price
1 2007-01-14 10
1 2007-01-18 10
1 2007-01-20 10
1 2008-05-08 11
1 2010-05-15 11
1 2010-08-09 11
That means when the date in the query match between the from and till. I want the price from that colomn. Ok to do this thats not the problem but.
If the date of my query is not in the range of my table I want the price of the range with newest range
so date 2010-08-09 should give me the price out of the table 1 2008-01-01 2009-12-31 11
Because the "till"date is most nerest to the date in my query
Who can help me?
I have a table like this
Product from till price
1 2007-01-01 2008-12-31 10
1 2008-01-01 2009-12-31 11
In a query I want to match this
Product date price
1 2007-01-14 10
1 2007-01-18 10
1 2007-01-20 10
1 2008-05-08 11
1 2010-05-15 11
1 2010-08-09 11
That means when the date in the query match between the from and till. I want the price from that colomn. Ok to do this thats not the problem but.
If the date of my query is not in the range of my table I want the price of the range with newest range
so date 2010-08-09 should give me the price out of the table 1 2008-01-01 2009-12-31 11
Because the "till"date is most nerest to the date in my query
Who can help me?