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]
|