I have two tables; One is a Standard Cost history table and one is a purchase order table. Both have a transaction date.
I am trying to figure out a way to compare the Purchase Order Price of an item on a particular day with the Standard Cost of an that item during that time.
Here an example record:
P.O.
Item Price Date Quantity
123 $1.00 01/01/2011 2
Standard Cost History
Item Cost Date
123 $0.98 09/01/2010
123 $1.02 04/01/2011
Because the Standard Cost of this item on 09/01/2010 was $0.98 and it didn't change again until 04/01/2011, the comparison should be against the this line, but how do I determine what line to compare against, since I require the nearest past date for Standard Cost history for the item in question?
Any help on this matter is greatly appreciated.
Thanks in advance,
Donald
I am trying to figure out a way to compare the Purchase Order Price of an item on a particular day with the Standard Cost of an that item during that time.
Here an example record:
P.O.
Item Price Date Quantity
123 $1.00 01/01/2011 2
Standard Cost History
Item Cost Date
123 $0.98 09/01/2010
123 $1.02 04/01/2011
Because the Standard Cost of this item on 09/01/2010 was $0.98 and it didn't change again until 04/01/2011, the comparison should be against the this line, but how do I determine what line to compare against, since I require the nearest past date for Standard Cost history for the item in question?
Any help on this matter is greatly appreciated.
Thanks in advance,
Donald