I would tke the PayRate out of the Emp table and create a new [related] table for the PayRate. It would have fields:
[EmpId] [StDt] [PayRate] [EndDt]
[EmpId] is, of course the Key, relating back to the Employee Table.
StDt is the Starting (effective) date for the payrate
[PayRate] is, of course the Rate of pay effective on the [StDt]
[EndDt] is the date when the payrate (of this record) is changed/altered ...
So, when you use this, the Current rate is always just the one with no [endDt]. For all other purposes, you need to use the date of interest and find the record where the date is between [stDt] and [EndDt]
The scheme can - obviously - do without the [EndDt], simply by using the Most recent record for the [EmpId] as the current payrate, but then finding the correct rate for other dates becomes (slightly) more complex. Keeping the [EndDt] field simplifies thr retrieval of pay for "back dated" inqurires at the expense of needing to be SURE that whenever there is an adjustment to the pay, it is filled in.
The situation you are facing is a direct result of not-normalizingn the database tables at design time. While this is a common situation, it is also one of the primary causes of most db failure. You shoud either get someone (a PROFESSIONAL) to review your db or at the very least, do a VERY THOROUGH internal review. The review (wheather from an independent professional or your internal group needs to include managers of all departments and functional areas of the company
MichaelRed
redmsp@erols.com
There is never time to do it right but there is always time to do it over