January 20, 200917 yr Hi, How would you model the structure of the tables to know what was the price of a product in time? In a billing system it's important to keep the price up to date and also keep the price paid for a product for a specific time. This is one of my approach products (pkProductID, price (lookup from prices), ...) prices (pkPriceID, fkProductIDprice, date, ...) billDetail (fkProductID, fkBillID, price (lookup from product), ...) Thanx for any other suggestion.
January 20, 200917 yr The price in Products is redundant. The line item (billDetail) can lookup directly from Prices, based on ProductID and either the date or just the most recent price (depending on whether you have future prices and/or bill retroactively).
January 20, 200917 yr Author To get the most recent price, I will need to create a script? I'm I right or there's another way?
January 20, 200917 yr No, not at all - just sort the relationship by date (or by PriceID), descending.
Create an account or sign in to comment