View Single Post
 
Old 01-15-2018, 05:23 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

I've had a bit of a play with your data. Try the attached - it assumes the mailmerge main document is saved in the same folder as your workbook. The DATABASE field's code for this is:

{DATABASE \d "{FILENAME \p}/../DB Merge Data.xlsx" \s " SELECT FORMAT([Date Of Incident]&' '&[Time], 'DD-MMM-YYYY @ hh:mm') AS `Incident Date & Time`, [Location], Format([Amount],'$#,##0.00') AS Amount, Format([Charge],'$#,##0.00') AS Charge, Format([Service Fee],'$#,##0.00') AS `Service Fee`, [Invoice Date] FROM [Detail$] WHERE [ID] = {MERGEFIELD ID} ORDER BY [Invoice Date] " \l "15" \b "49" \h}

The field coding assumes the workbook name is 'DB Merge Data.xlsx' and that the worksheet name is 'Detail'. Change the names in the field to suit.
Attached Files
File Type: docx Incident Merge.docx (28.1 KB, 309 views)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]