I have a table where I am storing the entire Price History (tblPriceHistory) of each product being sold.
The table is very simple. Contains the following fields:
ProductID,
UnitPrice,
BeginDate,
EndDate.
On one of my forms in the database, I currently have a Line Chart that displays the price changes over the entire history of the product. The chart works just fine now, however, the client has asked for a change that is going a bit beyond my skill level. The current chart was built using a very simple query against the table.
Right now, the chart plots a data point for each and every price change that has been logged into the table. The problem is that some products have not seen a price increase since their inception 3 years ago...in which case the chart only displays one data point. Others have had a price change at some point in their history, but maybe only every 3-4 years. While the chart is still technically correct, the client wants to always display the price as of the first of January for every year after the product came into existence.
One thought I had was to create a January 1 record for each product, whether or not there was a price change on that date or not. While that would get me the Chart I want, I feel like it is bastardizing the data.
Looking for a way to build a recordset that would populate the Chart and it would include A.) every actual record in the table (tblPriceHistory) and B.) the price that would have been in effect between every January 1st after the first effective date and now.
The table is very simple. Contains the following fields:
ProductID,
UnitPrice,
BeginDate,
EndDate.
On one of my forms in the database, I currently have a Line Chart that displays the price changes over the entire history of the product. The chart works just fine now, however, the client has asked for a change that is going a bit beyond my skill level. The current chart was built using a very simple query against the table.
Right now, the chart plots a data point for each and every price change that has been logged into the table. The problem is that some products have not seen a price increase since their inception 3 years ago...in which case the chart only displays one data point. Others have had a price change at some point in their history, but maybe only every 3-4 years. While the chart is still technically correct, the client wants to always display the price as of the first of January for every year after the product came into existence.
One thought I had was to create a January 1 record for each product, whether or not there was a price change on that date or not. While that would get me the Chart I want, I feel like it is bastardizing the data.
Looking for a way to build a recordset that would populate the Chart and it would include A.) every actual record in the table (tblPriceHistory) and B.) the price that would have been in effect between every January 1st after the first effective date and now.