Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 04-04-2022, 04:20 PM
macropod's Avatar
macropod macropod is offline Mailmerge problem using Database field Windows 10 Mailmerge problem using Database field Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,382
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

You have a simple mis-match between a field name in the source and the field name in the DATABASE field (i.e. Format([Total to be paid],'£#,##0') AS `Total claim` should be Format([Total claim],'£#,##0') AS `Total claim` or as Format([Total claim],'£#,##0') AS `Total to be paid`).

Your field coding could also be simplified somewhat:
{DATABASE \d "{FILENAME \p}/../list.xls" \s " SELECT Format([Period], 'MMM-YYYY') AS `Period`, [Type], Format([claimed],'£#,##0') AS Claimed, Format([Paid],'£#,##0') AS Paid, Format([fine 50%],'£#,##0') AS `Fine 50%`, Format([Penalties 10%],'£#,##0') AS `Penalties 10%`, Format([Fixed fine],'£#,##0') AS `Fixed fine`, Format([Penalties pid],'£#,##0') AS `Penalties pid`, Format([Total claim],'£#,##0') AS `Total claim`, Format([Interests],' DD-MMM-YY ') AS Interests FROM [Invoices$] WHERE [name] = '{MERGEFIELD name}' ORDER BY [Period]" \l "23" \b "1087" \h}
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ref field to Database field doesn't update properly in Mailmerge huynguyen865 Mail Merge 1 08-30-2021 07:30 AM
Mailmerge problem using Database field Macro to insert an image to a word mailmerge document based on the value of a mailmerge field? Jake93 Mail Merge 3 07-02-2019 05:38 PM
Mailmerge problem using Database field database field table lines Sarki76 Mail Merge 3 06-26-2019 03:13 PM
Database field cell alignment scubadunc Mail Merge 9 08-12-2014 11:02 PM
Mailmerge problem using Database field insert database as field david_89_ Mail Merge 3 03-26-2014 06:02 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:07 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft