mikekal
Member
- Local time
- Today, 04:03
- Joined
- Jun 24, 2017
- Messages
- 114
I download your example but when im change the price do nothing.Holds the past price for the productcreate Another table for the Price:
tblPricing (table)
ItemID (long) 'FK to inventory table
EffectiveDate (date) 'when this price is applicable
Price (Decimal) 'the price
if i choose product c and change the price,in new event when im choosing the product ,the price is still the oldof course it will hold the last price of the item.
that was already a history and is past.
you can only change the current price.
its ok i test the base and its okif i choose product c and change the price,in new event when im choosing the product ,the price is still the old
As Pat noted, "Price as Of" is not the same thing logically as "Price". In addition, there are multiple ways the actual price charged can differ from a list price anyway. Discounts for preferred customers, for example. You either have to account for that as a price different from list at that point, or a separate discount field. It's not exactly a violation of normalization, although it has a certain feel to it that makes you stop and think through it.As your price table enables the of the price applicable to any order because you can determine the price applicable at any date, storing the price in the order table is redundant. Having noted that, I would have probably decided to store the price in the order table to facilitate reports.