Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-23-2014, 11:44 AM
Jake0254 Jake0254 is offline Mail Merge Field - Trying to divide time however receiving !Syntax, ; Windows 7 32bit Mail Merge Field - Trying to divide time however receiving !Syntax, ; Office 2013
Novice
Mail Merge Field - Trying to divide time however receiving !Syntax, ;
 
Join Date: Sep 2014
Posts: 1
Jake0254 is on a distinguished road
Default Mail Merge Field - Trying to divide time however receiving !Syntax, ;

Hello



I am merging to a csv dataset and have a field called 'TotalQuantity' and another called TotalPeople

There are currently five sample records in my table...

Total Quantity: 05:00, 05:00, 02:00, 10, 13
Total People: 5, 5, 2, 10, 13

I need to be able to divide the total quantity by total people.. I have created the {= {MERGEFIELD TotalQuantity } / {MERGEFIELD TotalPeople} }

However this returns a Syntax error. Please help!

FYI, if I try and do it on excel, it works. So it isn't a formatting issue that I'm aware of.

Thanks, Jake.
Reply With Quote
  #2  
Old 09-24-2014, 12:58 AM
macropod's Avatar
macropod macropod is offline Mail Merge Field - Trying to divide time however receiving !Syntax, ; Windows 7 64bit Mail Merge Field - Trying to divide time however receiving !Syntax, ; Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

Are your field's internal braces (i.e. { }) created via Ctrl-F9? You can't just type them.

Furthermore, it looks like some of your data are times, expressed in HH:mm. Unless your 'Total Quantity' is always a whole number of hours, you will not get meaningful results with your current approach, as Word's formula fields cannot evaluate times this way. A moderately-complicated field code would be needed to convert the time into minutes, do the division then convert the results back to HH:mm -

{QUOTE{SET AvgTime {={={MERGEFIELD Total_Quantity \@ hh}*60}/{MERGEFIELD Total_People} \# 0}}{=INT(AvgTime/60)*100+MOD(AvgTime,60) \# "00:00"}}

Note: The field brace pairs (i.e. '{ }') for the above example are all created in the document itself, via Ctrl-F9 (Cmd-F9 on a Mac); you can't simply type them or copy & paste them from this message. Nor is it practicable to add them via any of the standard Word dialogues.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail Merge Field - Trying to divide time however receiving !Syntax, ; Mail Merge - Age field jay_son Mail Merge 1 06-30-2014 02:33 PM
time field issue in mail merge Aude Mail Merge 16 05-18-2014 06:22 AM
Mail merge how to link mail merge field value to a column heading dsummers Mail Merge 1 05-08-2014 02:59 PM
Mail Merge Field - Trying to divide time however receiving !Syntax, ; How to ignore a mail merge field if the field is blank redzan Mail Merge 1 05-16-2013 08:34 AM
Mail Merge Field - Trying to divide time however receiving !Syntax, ; How big can a mail merge field be? Engineer Mail Merge 2 12-11-2012 01:20 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:14 PM.


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