Adding a value to a mailmerge value

  • Thread starter Pascal Duchemin
  • Start date
P

Pascal Duchemin

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
 
D

Doug Robbins - Word MVP

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

--
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
 
P

Pascal Duchemin

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 !
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top