Please excuse my formatting... I am working on that.
I am trying to select the correct price of a project in my query based off the appropriate effective date.
For example we have a table that has the following information
Price Table-------------------------
Item Price effectiveDate
- A $0.57 1/1/17
- A $0.72 6/1/17
Now I have a production table that contains what was produced that day and it will list out their quantity and the production for a production date.
Production Table-------------------
Item Quantity productionDate
- A 100 2/1/17
- A 100 7/1/17
Now when I query these I want to be able to select the appropriate price given the productionDate and effectiveDate.
What is the best way to achieve this?