A table of mine contains rates inserted 5 days a week (monday to friday).
2007-12-19 | 450.00
2007-12-18 | 451.00
2007-12-17 | 448.00
.....
2007-11-19 | 448.00
2007-11-16 | 442.00
2007-11-15 | 444.00
Now I want to find the difference in ie. a 30 day period from todays date (2007-12-19). That would be easy enough as there is a matching row (2007-11-19).
However 30 days prior to 2007-12-18 would not work out. Technically the row with date 2007-11-16 should be selected to find the difference.
How, if possible do I format a query for this?