Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have the following tables.
1. A table with the current stock on a specific date. This date is only calculated when a stock mutation is made. The table looks like this:
Article | Date | Mutation | Stock |
---|---|---|---|
Article1 | 10-08-2013 | +10 | 10 |
Article1 | 12-08-2013 | +5 | 15 |
Article2 | 09-08-2013 | +40 | 40 |
Article2 | 20-08-2013 | -10 | 30 |
2. A table with the value (price) of an article on a specific date. These prices can change daily.
Article | Date | Price |
---|---|---|
Article1 | 10-08-2013 | € 20 |
Article1 | 11-08-2013 | € 25 |
Article2 | 08-08-2013 | € 10 |
I want to calculate the value of the stock at the end of the month. Problem is, the dates dont always match. How can I use the latest price in a month? I prefer not to merge the tables, cause I think it will result in an unclear data structure.
I think that the best solution would be to combine the two tables in one, and then create another table just for the month end stocks and prices, but if you prefer not to combine, this should be the solution
PFA
Really helpful mate, thanks alot! I will be able to do what I wanted thanks to your example.
EDIT: I'll keep this unanswered till I actually fixed it. Maybe i'll have some more related questions.