dan-cat
Registered User.
- Local time
- Today, 04:17
- Joined
- Jun 2, 2002
- Messages
- 3,433
Hello All,
Ok I'm still a little rusty as to when and why you shouldn't store a value.
Take, for example a db designed to process timesheets.
Timesheet form details employee, rate of pay, total hours and total pay
Timesheet continious sub-form details date, starttime, finishtime and total hours worked for the day.
Now I'm assuming that the total hours field and the rate of pay field(taken from a seperate employee table) within the timesheet form should not be stored in the timesheet table but calculated.
I understand the principle behind it because it avoids bloating and duplication.
However what happens if the user goes into the employee table and changes the rate of pay for a specific employee? All the historic records will be recalculated with the new rates of pay.
Is there a point where storing values is preferable to calculating?
Thankyou
Dan
Ok I'm still a little rusty as to when and why you shouldn't store a value.
Take, for example a db designed to process timesheets.
Timesheet form details employee, rate of pay, total hours and total pay
Timesheet continious sub-form details date, starttime, finishtime and total hours worked for the day.
Now I'm assuming that the total hours field and the rate of pay field(taken from a seperate employee table) within the timesheet form should not be stored in the timesheet table but calculated.
I understand the principle behind it because it avoids bloating and duplication.
However what happens if the user goes into the employee table and changes the rate of pay for a specific employee? All the historic records will be recalculated with the new rates of pay.
Is there a point where storing values is preferable to calculating?
Thankyou
Dan