View Single Post
 
Old 04-12-2023, 05:00 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,994
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

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}
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote