I noted this thread yesterday and I thought that one of the responses hit the nail on the head - you are going to have to do some manipulation of the table that holds the costs by adding a second date field so that each price for each product includes that date range of its effectiveness. Then you can do an SQL statement linking the invoice date to the correct cost per the date range. Is there some problem with manipulating that table or copying that table so that you can do something like this?
A problem is a problem only as long as it has a possible solution. Lacking that, it becomes a FACT!