473,408 Members | 2,441 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

convert numbers to county names

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.

Mike

May 2 '06 #1
3 1464
"Takeadoe" <mt********@msn.com> wrote in
news:11**********************@j33g2000cwa.googlegr oups.com:
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.

Mike


The join is the right way to go. Using the join to relate the
county names in forms and reports is proper relational database
design. Importing the names to your main table is a bad thing to
do, as the text in many places wastes spece, allows spelling
errors to cause corrupted data, etc.

Access is very good in allowing you to use the countyID (number)
to retrieve the countyName (text).
--
Bob Quintal

PA is y I've altered my email address.
May 2 '06 #2
Say you have two tables:

CountryList(
CountryID,
CountryName)

OtherTable(
FieldX,
FieldY,
CountryID,
....)

So you need to add a TEXT field to "OtherTable" that's long enough to
store the longest country value. Call it "Country".

Then you can use something like this to update Country field in
OtherTable...

UPDATE tblCountryList INNER JOIN tblFixMe ON tblCountryList.CountryID =
tblFixMe.CountryID SET tblFixMe.CountryName =
[tblCountryList].[CountryName];
I know... now you're really confused because my names don't match up.
So focus on the SQL. If you copy and paste it into the QBE grid (hit
the SQL button first), you'll get the picture...

May 2 '06 #3
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-----
May 2 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: D McM | last post by:
I am working on a license program in Access 2000. Every year, the county assigns a block of numbers to be used. When someone applies for a license, they are assigned from that group. For...
1
by: kmnotes04 | last post by:
I have a data entry form that contains drop-down lists such as 'Assigned to:' with a list of staff member names. Those names end up as numerical codes in the main table ('ProjectInfo') of the...
8
by: Adam Clauss | last post by:
I have a folder containing many subfolders (and subfolders and....) all containing various .cs files. Is there any "easy" way to get them all added to the solution. Preferable would be that the...
4
by: Leon | last post by:
How do I get a table to autpmatically enter the County name in the next field when I enter the City name? ----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----...
5
by: Bob Homes | last post by:
In VB6, foreground and background colors of controls had to be assigned a single number. If you knew the RGB values for the color, you still had to convert them into the single number accepatable...
9
by: jasonrholland | last post by:
i have to build a table within access that receives it's information from an ASP web page and generates the primary key, with numbers and letters, from the data submitted. a numer would be like...
8
by: flyingisfun1217 | last post by:
Hey, Sorry to bother everybody again, but this group seems to have quite a few knowledgeable people perusing it. Here's my most recent problem: For a small project I am doing, I need to...
5
by: Bubba | last post by:
I have a dynamic pulldown list (ASP with javascript) that when a user picks a state, the corresponding counties for that state appear in a dynamic second pulldown list. When I submit the form, the...
3
by: jim | last post by:
Does anyone know why the query below would return numbers? I'm attempting to produce a report that shows in *one* column the names that appear in multiple columns in a single table. Table Name:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.