View Single Post
  #3 (permalink)  
Old October 15th, 2007, 12:53 PM
SerranoG SerranoG is offline
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG

This is an odd table structure. If you want to keep a history of prices, I would just have one price field and one date field to show what the price was at that date. Say the price was first set on 9/1/2007, so instead of:

CustNum, P/C, PreviousPrice, FuturePrice, EffectiveDate

I would have

CustNum, P/C, Price, EffectiveDate
80000, 123456, 0.1234, 9/1/2007
80000, 123457, 1.1234, 10/01/2007

In that way, you can always track price vs. date and get a history. To get any price increase difference, just subtract the two prices for any two given dates.

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
Reply With Quote