Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / January 2006

Tip: Looking for answers? Try searching our database.

Adding a value to a mailmerge value

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Pascal Duchemin - 06 Jan 2006 15:52 GMT
Hello,

Is it technically possible to add a value to a merged data ?

Let's say add 10 months to a date retrieved from a merged data or a
number to another merge data.

If yes, how do I do this ?

Thanks
Doug Robbins - Word MVP - 06 Jan 2006 16:50 GMT
Adding a number to a numeric field is quite simple using the following field
construction

{ = 10 + { MERGEFIELD Number } }

Adding to dates is a bit more complex because you may exceed the number of
months in a year.  As a result, you need the following field construction

{ IF { = 10 + { MERGEFIELD Date \@ "MM } } < 13 "{ = 10 + { MERGEFIELD Date
\@ "MM" } }/{ MERGEFIELD Date \@ "dd" }/{ MERGEFIELD Date \@ "yyyy" }"  "{ =
10 + { MERGEFIELD Date \@ "MM" } - 12 }/{ MERGEFIELD Date \@ "dd" }/{ = 1 +
{ MERGEFIELD Date \@ "yyyy" }}" }

You must use Ctrl+F9 to insert each pair of field delimiters { }.

For a wealth of information on date field calculations in Word, see:

http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Number=249902

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> Hello,
>
[quoted text clipped - 6 lines]
>
> Thanks
Pascal Duchemin - 13 Jan 2006 14:30 GMT
Thanks a lot for your information.

The simple addition worked fine, howerver the date manipulation did not
even though things looked right.
I made the addition at the SQL server statement level and things are
working ok now. One day when I'll have more time I'll check again how to
make that date adding script work

Thanks again !

> Adding a number to a numeric field is quite simple using the following field
> construction
[quoted text clipped - 14 lines]
>
> http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Number=249902
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.