I've simplified the example somewhat but essentially im looking for a way of calculating the cost price of items recently sold based on a FIFO methods.
Here's two basic tables (somewhat simplified)
[Sold] ITemID, SaleDate, QTY, Price
1, '2009-05-01', 2 ,£13...