View Single Post
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Mail Merge using two different data sources.

If your database is a "proper" database such as Access or SQL Server, then
there it is possible to write queries (in Access) or Views (in SQL Server)
that collect the data from several tables into a single "result" table, as
long as there is sufficient information to connect the pieces of data
together.

It's difficult to be specific without knowing what type of database you are
using and the exact tables and columns involved and how they are related,
but...

For example, if you have a database where each individual's main data is in
a table called person, and has a /unique identifier/ called personID, and
there is a separate table called address that stores each individual's
address, but which also has the same unique ID called personID, then you
would typically be able to use the language SQL to construct a query that
says

SELECT * FROM person, address WHERE person.personID = address.personID

That creates a third, "logical" table that you can use as the data source
for a merge.

It might be slightly more complicated, e.g. each person might have several
different address records, in which case the query might have to be
different.

Typically with a databse sch as this one, not everyone has permission to
create queries/viws within the database itself. If you don't you either have
to get someone else to create the query you need, or you can sometimes
create it in a thing called MS Query that comes as part of MS Office, or you
may be able to create it using Word VBA. But maybe you could find out a
little bit more about your database before we get into that? e.g. what type
of dtaabse is it, what permissions do you have to create queres or views,
what "data strcutures" are used to contain the data you need, and so on.

Peter Jamieson
"Ru4reele" wrote in message
...
I need to merge a word document with an outside database source. Apparently
within the database are tables. It appears that the address is in one
table,
and the customer email address and contact info is in another. Is there
anyway to specify to word to take information from certain fields from
different data sources, or does it all have to come from one source?