Multiple queries

D

Danny

I am using Word 2007 and a SQL Server database. I am trying to create a mail
merge to send letters to customers, but also list the orders at the top of
the letter. The tables are Customers, Orders, CustomerOrders. Is there a way
of executing a second query so I can use the CustomerOrders table to list the
orders at the top of each letter? Or any other way?

Thanks
Danny
 
M

macropod

Hi Danny,

You can use Word's Catalogue/Directory Mailmerge facility for this (the terminolgy depends on the Word version). To see how, check
out my Word 97-2007 Catalogue/Directory Mailmerge Tutorial at:
http://www.wopr.com/index.php?showtopic=731107
or
http://www.gmayor.com/Zips/Catalogue Mailmerge.zip
Do read the tutorial before trying to use the mailmerge document included with it.

Adding text after the repeated data requires adding a dummy final record or a field indicating the last record in each set, to the
source data. Unless you're able to do that with your database, you may need to use an ordinary Catalogue/Directory Mailmerge first,
to extract the raw data to a Word table. That's so you can add the required extra record (or the extra field and its last record
indicators) before using the Word table as the data source for the final merge.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top