Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

update values

Status
Not open for further replies.

tatika

MIS
Oct 6, 2003
35
US
Hi,
Hope somebody can help me with this issue
My database has a table that holds employees salary. I use this table often in order to calculate bi-yearly expenses.
My problem is that some of the employees listed on the table are getting a salary increase.
If I update their salary in the table itself, all my previous calculations based on the old salary will be updated as well.
I would like to change the salary amount, but at the same time keep old records intact from alteration.
Any ideas?
 
I would set up another table one would be for current data and the other for the data you don't want changed.. You can perform calculations using on or both of the tables and put the result where you wish

Cretin
 
OR, you could make another column in your salary table that simply contains an integer value of 0 or 1. Then whenever you tell your db to do calculations on the salary field for your bi-weekly expenses, have your code first interogate the new field, and if 0, for example, this could mean that the person in that salary record has NOT had a raise and its OK to do the calc on it. Conversly, if the field is a 1, this would mean that that person HAS had a salary and the calc should not be done on the (salary)field in that record. You would have the maintenance of keeping that new field accurate to 0 or 1 when people get raises, of course, but this would not seem to be too difficult. Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top