I am drawing a total blank on how to pull this one off.
I have two tables. One for item transactions and one for the cost of item based on the date of the transaction.
Table 1Part - Bin - Qty - Date (String Value - YYMMDD)
Table 2Part - Bin - Price - Effective_Date (String Value - YYMMDD)
For each record in Table 1 I need to pick the correct price in Table 2. In Table 2 where the 'Date' is greater than or equal to the Effective_Date but less than the next most recent Effective_Date is the correct price.
So in Table 1, I have:
Part = ABC
Bin = PURCH
Date = 161003
Table 2 has:
Part Bin Price Effective_Date
ABC PURCH 1.00 160101
ABC PURCH 2.00 160929
ABC PURCH 3.00 160926In this case the correct 'Price' would be 2.00.
The part that is throwing me is normally I see a beginning and ending date for effective pricing or such. In this case it is not boxed in nicely.
Any Suggestions would be greatly appreciated!
Edited by ReportWriter14 - 03 Oct 2016 at 10:18am