This shouldn't be a tough problem, but for some reason I'm stumped. I've got a huge database which has city names in it. The names themselves are outdated and I have to replace the names (e.g. Attleboro Falls is now North Attleboro). There are over 500 names to replace, so I can't do it one by one. I have a table of the old city names [OriginCity] and new names [OriginMunicipality] in one table, but I want to apply them to my larger table of more than 500 observations (some of which includes no entries for cities).
Here's my code:
UPDATE [City Municipal Table] INNER JOIN MA2007_10 ON ([City Municipal Table].DestMunicipality = MA2007_10.DestCity) AND ([City Municipal Table].OriginMunicipality = MA2007_10.OriginCity) SET MA2007_10.OriginCity = [OriginMunicipality], MA2007_10.DestCity = [DestMunicipality];
City Municipal Table is the table with the old and new names lined up, MA2007_10 is the table I want to change the names in. I'm doing this for two columns, [OriginCity] and [DestCity], though they contain the same names.
Any thoughts? Thanks!
Here's my code:
UPDATE [City Municipal Table] INNER JOIN MA2007_10 ON ([City Municipal Table].DestMunicipality = MA2007_10.DestCity) AND ([City Municipal Table].OriginMunicipality = MA2007_10.OriginCity) SET MA2007_10.OriginCity = [OriginMunicipality], MA2007_10.DestCity = [DestMunicipality];
City Municipal Table is the table with the old and new names lined up, MA2007_10 is the table I want to change the names in. I'm doing this for two columns, [OriginCity] and [DestCity], though they contain the same names.
Any thoughts? Thanks!
Last edited: