#16
|
|||
|
|||
I've update the original post with attachments I've been playing around with. maybe that helps to solve my issue? Data source path was actually full path. Without the sql I was able to print the rows from Sheet 2. With the sql I get the error I was talking about |
#17
|
||||
|
||||
You have omitted the {FILENAME \p} field from the DATABASE field code. You also have a paragraph break after { MERGEFIELD Manager_ID }.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#18
|
|||
|
|||
still no luck
Hi, going insane. I've managed to get a copy of the examples above working as it should. However with my own data it doesn't fly. Would you mind taking a look and see what I'm doing wrong?
{ MERGEFIELD producentid } { MERGEFIELD producentnaam } {DATABASE \d "{FILENAME \p}/../factuur.xlsx" \s " SELECT [ean], [rate], [count], [market], [deposit], [pb], [vat], [amount] FROM [overview$] WHERE [producentid] = {MERGEFIELD producentid} ORDER BY [amount] " \l "15" \b "49" \h} factuur.docx factuur.xlsx |
#19
|
||||
|
||||
Since your {MERGEFIELD producentid} outputs a number, you need to enclose it in tick marks:
{DATABASE \d "{FILENAME \p}/../factuur.xlsx" \s "SELECT [ean], [rate], [count], [market], [deposit], [pb], [vat], [amount] FROM [overview$] WHERE [producentid] = '{MERGEFIELD producentid}' ORDER BY [amount]" \l "15" \b "49" \h}
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#20
|
|||
|
|||
Yes! You're a hero, thx
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Merge one Excel file into multiple Word Documents | Rushpac | Mail Merge | 2 | 01-27-2017 02:49 PM |
Insert slip sheets during a mail merge | mcboats2 | Mail Merge | 1 | 12-07-2015 05:01 PM |
Mail merge from excel - need to create sheets and create a table | bluenosebex | Mail Merge | 5 | 08-02-2015 05:34 PM |
Code for mail merge to reference saved excel file | jtemp57 | Word VBA | 10 | 12-16-2013 11:02 PM |
How do I merge data from one sheet in a workbook out into multiple sheets | nolesca | Excel | 4 | 06-07-2010 08:13 AM |