TRANSPOSE FIELDS IN ACCESS DATABASE

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a database that contains a field called ROLE which contains data such
as 'ch1','ch2','ch3', etc. and another field called NAME which contains a
name (imagine that). I want to use the database as a data source for a Mail
Merge letter in Word, but to do that, I need fields that are named CH1 and
contain the data from the field called NAME. How can I accomplish that
without creating a new database and manually entering the required names into
their respective ROLE fields. I've tried writing a query to accomplish this,
but have not been successful (humanspeak="I failed"). Thanks.

Jan
 
Jan

You have a field that contains codes/roles, including one with a value of
"ch1". In the same table (you said database, but I assume you are talking
about an Access table), you have a field named "Name" (by the way, Access
considers the word "Name" to be reserved -- you and Access with both have
headaches resolving which "Name" you are referring to until you change this
field's title to something else, say "EmployeeName", or ....).

If you create a new query and add your table, you can select the Role field
and the "XName" field into the grid in the lower portion of the query
designer.

Beneath the Role you'll find a row for Criteria -- put your "ch1" there.

Run the query -- this should return all rows that have a "ch1" in Role,
display "XName".
 
Back
Top