I have a table [Consolidated] which lists employees. The SSN used to be used as the primary key (it was legal, given it was a government database), but now I want to delete that field and replace it with a new primary key. I have fields [LName] [FName] [MI] and [Last4] among several others. [Last4] refers to the last 4 digits of their SSN.
I want to create a new field in the SAME table [Consolidated] that combines the [LName] and [Last4] fields, creating a unique identifier that is easy to remember. Example: [LName] = "Smythe" and [Last4] = "3434". The new [EmpID] would generate "Smythe3434 " or maybe "SMYT3434" (First 4 letters of last name and Last4).
Any advice on how to have [EmpID] automatically generate upon filling in [LName] and [Last4]?
I want to do this because:
Using only the [Last4] would generate duplications after 9,999 people. My database won't ever have that many people, so this is unlikely to happen, but possible.
Obviously, I don't want to use only [LName], as I already have four pairs of individuals with the same last name.
But two people having exactly the same last name and the same last 4 of SSN is HIGHLY unlikely. Using this format is something that comes naturally to employees, as many of the websites they access requires a similar format for their userid. But I have never done this within this database. It is time for it to be done.
I want to create a new field in the SAME table [Consolidated] that combines the [LName] and [Last4] fields, creating a unique identifier that is easy to remember. Example: [LName] = "Smythe" and [Last4] = "3434". The new [EmpID] would generate "Smythe3434 " or maybe "SMYT3434" (First 4 letters of last name and Last4).
Any advice on how to have [EmpID] automatically generate upon filling in [LName] and [Last4]?
I want to do this because:
Using only the [Last4] would generate duplications after 9,999 people. My database won't ever have that many people, so this is unlikely to happen, but possible.
Obviously, I don't want to use only [LName], as I already have four pairs of individuals with the same last name.
But two people having exactly the same last name and the same last 4 of SSN is HIGHLY unlikely. Using this format is something that comes naturally to employees, as many of the websites they access requires a similar format for their userid. But I have never done this within this database. It is time for it to be done.
Comment