Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / June 2006

Tip: Looking for answers? Try searching our database.

Database into a table

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
C Wood - 01 Jun 2006 18:00 GMT
I am trying to setup a document that pulls data from Excel databases and
places the information into a table.

The fieldcode looks like this:
{DATABASE \d "T:\\Program Review\\Program Costs.XLS" \c "Entire Spreadsheet"
\s "SELECT fte FROM T:\\Program Review\\Program Costs.XLS WHERE ((progid =
0201))"}

This works fine when it is used outside of a word table, but when I copy the
field into a table, I get: Error! Not a valid result for table.

What I am trying to do is setup a table that pulls data for 4 years of data
- each year in its own column.

Is there a better way to do this?
Doug Robbins - Word MVP - 01 Jun 2006 18:38 GMT
Maybe just use a catalog (or in XP and later a directory) type mailmerge
main documnet in which you have a one row table with the mergefields in the
cells of that row.  When you execute the merge to a new document, it will
contain a table with a row of data for each record in the data source.

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

>I am trying to setup a document that pulls data from Excel databases and
> places the information into a table.
[quoted text clipped - 14 lines]
>
> Is there a better way to do this?
C Wood - 01 Jun 2006 18:47 GMT
Actually, what I am trying to do is pull specific records into different
documents.

For example, I have a database of college programs with various data such as
enrollment, etc.

I then have a Word document for each specific college program that needs to
pull the data from the database for that pariticular program, and hence my
use of the SQL statement

> Maybe just use a catalog (or in XP and later a directory) type mailmerge
> main documnet in which you have a one row table with the mergefields in the
[quoted text clipped - 19 lines]
> >
> > Is there a better way to do this?
Peter Jamieson - 01 Jun 2006 18:52 GMT
Yes, i don't know why it does that. Try nesting the DATABASE field inside a
SET field, e.g.

{ SET A { DATABASE <your text> } }

then put { A } or { REF A } in the table. It seems to work here.

Peter Jamieson
>I am trying to setup a document that pulls data from Excel databases and
> places the information into a table.
[quoted text clipped - 14 lines]
>
> Is there a better way to do this?
C Wood - 01 Jun 2006 20:46 GMT
That does the trick - thanks

> Yes, i don't know why it does that. Try nesting the DATABASE field inside a
> SET field, e.g.
[quoted text clipped - 22 lines]
> >
> > Is there a better way to do this?

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.