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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fix name field so all names are entered the same

Status
Not open for further replies.

Zonie32

Technical User
Jan 13, 2004
242
US
I have a database with 4000 records. There is one field called AgentName that was originally manually entered by several people. So, there are many mismatched names for the same person. Depending on who entered the name, some people entered the full name, some entered a middle initial, some did not. Some put a period after the middle initial, etc.

Is there a way to quickly clean up the names in this field that are mismatched so they are all uniform? There is also another field called AgentID which is linked to the agentname, but the name linked to that number is not always spelled the right way. Any help is appreciated.
 
Hi, is the AgentID unique? if so then you can use this to normalise your agentnames. A query like this
Code:
SELECT YOUR_TABLE.AgentID, First(YOUR_TABLE.AgentName) AS FirstOfAgentName
FROM YOUR_TABLE
GROUP BY YOUR_TABLE.AgentID;
will give you a single name for each id. Personally I'd recommend normalising your database so that you create a new table, LU_AGENT_DETAILS or something which holds all of the details relating to your agents inc the id and your other table only holds the id. However, since this may involve drastically redesigning your database you could also use the above query to update your table...

HTH, Jamie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top