Help with doing calculations

i have a table that contains pay rate.

rid jid rdate rate
1 1 2006-01-01 18.00
2 2 2006-01-01 26.00
4 1 2007-05-01 20.00
5 2 2011-05-18 27.00

i need to use a specific rate depending on when the bill was entered. so if the bill date is 2011-05-18 then i would use the rate of 27. i have a report that pulls up multiple bills depending on date ranges. I can’t figure out how to code it so it would work with the correct rate.

any help would be greatly appreciated!