#1
|
|||
|
|||
Again Mail Merge from multiple sheet (MAC)
Hello, everyone. I have tried to follow the various tips in the forum, but I cannot solve my problem.
I have an excel file containing multiple sheets. In the same directory I have a word file which I use to generate the final documents. In the excel file the sheets are called "Sheet1" and "Sheet2". In the word file the template completes correctly with the data it extracts from Sheet1. Now I would like to insert the data from Sheet2, but I keep having problems. I'm on Mac, in case this might have some impact on the query to be generated. I have tried making the following query: { DATABASE \d"{FILENAME \p}/../filename" \s " SELECT * FROM [Sheet2$] WHERE [ID Name] = { MERGEFIELD ID_Name } " \l "15" \b "49" \h } Basically, I wanted the query to go back to the path of the excel file from the path of the word file, select all the fields in Sheet2 where the column with the "ID Name" header was equal to the analysed "ID_Name" value used in word. 1) Unfortunately, the relative link doesn't seem to work, so I modified the path by putting the absolute address, and so I can start to do some tests... Even if I don't understand how to solve this first problem! 2) It doesn't select Sheet2, but automatically takes Sheet1... Here too I don't understand why. 3) The query returns an error, unless I delete "WHERE [ID Name] = { MERGEFIELD ID_Name }". So at least it returns results, but not filtered (and especially from Sheet1, as mentioned above Does anyone have any ideas on how I could fix this? Thanks |
#2
|
|||
|
|||
Text filtering in query string of database fields
If ID_Name is text, format your query string as follows;
WHERE [ID Name] = /"{ MERGEFIELD ID_Name }/" |
#3
|
|||
|
|||
Thanks, but it still doesn't work.
I'm afraid there is some problem with office on Mac. I downloaded the example available here: https://www.msofficeforums.com/mail-...html#post67097 I then tried to update the field but it says "Error. The data source cannot be opened", even though I haven't changed anything... Any ideas? |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Mail Merge Student Transcript - Multiple Years from multiple sheets | aizah2018 | Mail Merge | 1 | 11-11-2018 01:27 AM |
Mail Merge to multiple employees in multiple locations as PDF by location | GFiz | Mail Merge | 1 | 05-13-2017 08:01 PM |
mail merge from excel sheet | mahesh kumar gupta | Mail Merge | 2 | 08-09-2015 03:10 AM |
Mail merge, text boxes, and two documents per sheet! | MelissaAnnie | Mail Merge | 2 | 09-24-2014 03:46 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 |