MS Access 2013 record history

1021557

Board Regular
Joined
Dec 14, 2007
Messages
54
Hi, I want to create a pay database for some employees. It will only need a few details one of which will be the department the employee is assigned to. However, when an employee moves from one department to another will I overwrite the department history such that if an employee moves form Department A to B will I lose the fact that they were in Dept A but now are in Dept B. In short how do I know where they are now and also importantly where they have been? Is their a setting when creating tables to do this or is their another way of keeping track of this?
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Hi,

Essentially you want to create a history of departmental changes based on the employees.

I would have 2 separate tables One for employee details and one for movement history.

The employee table with only hold 1 record of each employee based on a primary key (payroll number would be good) have a field called "current department" which contains there upto date department.

The History table will contain the employee number from the first, department name and 2 dates that represent the Start date in the department and the end date. If the employee is currently working in a department then you can leave the end date as null.

You can then join the two tables together in a query via the employee number and produce a output.

Depending on the scale you could manually keep this up to date or use an update query to update the employee table department name, where the history table end date is blank.

This way you can get a "where are they now" view and a "where have they been" view.
 
Upvote 0
Or add a checkbox field (e.g. CurrentDept) to the table to flag which is current. Your date fields will record start/end dates.
If you want to ensure that for any employee id only one dept can be True, make EmplID and CurrentDept a combined unique index or a composite primary key. For the latter, some say composite PK's are not the way to go, but I've dealt with them for many years and don't know the reason for that sentiment.
 
Upvote 0

Forum statistics

Threads
1,221,813
Messages
6,162,126
Members
451,743
Latest member
matt3388

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top