What I want to do is select a price from a table where the indicated date is between the start and end dates in the table.
SELECT price FROM table WHERE 'dategiven' BETWEEN startdate AND enddate
It is quite simple with a datetime filter. The problem is that I have several entries in the time window, I have a version column.
Below is an example of my table:

I want my query output to be as below, where my dategiven is 2013-08-25 
Milk has 3 entries, 2 of them are valid for dategiven (2013-08-25). Then I want to return the result with the highest version?
sort of:
SELECT price FROM table WHERE 'dategiven' BETWEEN startdate AND enddate AND max(version)
source share