Jemacc's advice is generally very true, but be careful to listen to what is asked. For example, Dearnne says, "...want to know what the savings are when the information was entered."
That raises a flag. Are you saying, Dearnne, that savings is dependent on WHEN it was entered and you need to save the number for historical reasons?
For example: exchange rates. Values based on those can be calculated; however, because exchange rates change daily, you WOULD have to store the actual exchange rate if you want to know what the value of something was from another country on a certain date.
In that case, Dearnne, you don't store the calculated value (listening Jemacc's good advice); you store the multiplier for that date, i.e. the exchange rate itself. Then if you want to know the value of something later, you THEN recalculate using the stored exchange rate.
So my question to you is, are you multiplying two numbers where the second number changes daily? If so, store the second number and its date, not the calculation of the two numbers. As jemacc says, you can recalculate anytime as long as you get the correct two numbers.
Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
|