View Single Post
 
Old 04-13-2023, 05:51 AM
vanishingpoint vanishingpoint is offline Windows 11 Office 2021
Novice
 
Join Date: Apr 2023
Posts: 5
vanishingpoint is on a distinguished road
Default

Quote:
Originally Posted by Guessed View Post
Word fields are not a great place to do mathematical calculations so I would prefer to address this via the SQL query (either in Word's merge or by creating the query in Access and then linking to that query in the Merge). For instance, this SQL works to round to nearest 5
Code:
SELECT [Last Name], [First Name], [Number1], [Number2], (Round([Number1]/5,0))*5 AS Num1, (Round([Number2]/5,0))*5 AS Num2
FROM Employees;
You can also do it as part of the merge by nesting the mergefield inside a calculation field
{=Round({MERGEFIELD Number1}/5,0)*5}
Awesome. Thanks.
Reply With Quote