Takeadoe wrote:
Brand New to the Access game. I was given a table with a field called
county. Values are 1-88 representing unique counties. I would like to
change these values to the actual county names. I'm at a loss as to
how to go about doing this. I would like the values changed
permanently. Do I do this in a query with a new variable, create
another table with just county names and join the two or what? I would
really appreciate any and all help.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
You would have to have a table (Counties) w/ both the number code and
the name of the county:
county_code county_name
1 Fairfield
2 Alameda
3 Contra Costa
.... etc. ...
If you wanted the code to be changed to the name, you'd have to be sure
the code column in the target table is a Text data type column. If not
you'd have to change it (in a query def SQL view enter & run this):
ALTER TABLE <table name> ALTER COLUMN county_code TEXT(40)
You can use whatever the maximum length of a county name is for the
number in TEXT parentheses.
Then you'd write an update query:
UPDATE <table name>
SET county_code = (SELECT county_name FROM Counties
WHERE county_code = <table name>.county_code)
Substitute your target table's real name for <table name>. Same for all
the column names.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBRFfsPoechKqOuFEgEQIIHgCgvL7iepbIIn1RTIXoGv831I NR0h4An3hA
r1EaL8A5ns6EBhgM74kcp+50
=3Bhl
-----END PGP SIGNATURE-----