Hi Jason,
>What I need to do, preferably in a query or set of queries, is to find the invoice value of all invoices between a certain period. This means that I must determine the correct value of each product when it was sold.
I'm no expert on SQL, so there's probably a better solution out there, but the following SELECT should give you the price of an item:
Invoices - inv no, inv date, part no, quantity, etc...
Price list - part no, price, effective date
Select Top 1 price, effective_date ;
From PriceList ;
Where part_no = invoices.part_no ;
and effective_date <= invoices.inv_date ;
Order by effective_date Desc
Without Top 1 it is the first record that contains the correct price.
Christof
--
Christof