View Single Post
  #3 (permalink)  
Old August 30th, 2004, 04:02 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
Default

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
Reply With Quote