View Single Post
 
Old 12-16-2021, 10:52 AM
bananapple bananapple is offline Windows 10 Office 2019
Novice
 
Join Date: Dec 2021
Posts: 6
bananapple is on a distinguished road
Default

Yea don't worry, I was using a 'letter' mail merge doc this entire time, I thought it would limit the file in another way but, after playing around with it, it didn't. That wasn't my issue. The issue was that I had a very silly typo in the field code, I was able to catch today... so sorry, been working long hours and it slipped by me. Once I fixed it I was able to reproduce the example from the links you posted and it worked marvelously!

However, as soon as I applied it to my own data-set, it gave me two errors:

(1) Error has occurred: Syntax error (missing operator) in query expression '[Soggetto] = 4ward S.r.l.'.
Note: 4wared S.r.l is the first item under the subject column in my excel file.

(2) Word was unable to open the data source.

Here is my field code. I really can't see what is wrong with it... I've been trying everything:

{DATABASE \d "{FILENAME \p}/../PEC Esternalizzatori_v.Stampaunione.xlsx" \s " SELECT [Nr. Documento], [Descrizione - PEC], [Tipologia Tassonomia] FROM [PEC$] WHERE [Soggetto] = {MERGEFIELD Soggetto} " \l "15" \b "49" \h}

According to the first message, the pain-point should be in the "WHERE [Soggetto] = {MERGEFIELD Soggetto}" part. I really can't seem to find any mistakes in this field code. Let me know if you see anything! The second error message hopefully will clear up once the first one is fixed.

Thank you so much again, I cannot begin to express how educating this has been for me.
Reply With Quote