Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Pascal Duchemin
 
Posts: n/a
Default Adding a value to a mailmerge value

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
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
 
Posts: n/a
Default Adding a value to a mailmerge value

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/show...?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

"Pascal Duchemin" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Pascal Duchemin
 
Posts: n/a
Default Adding a value to a mailmerge value

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 !

Doug Robbins - Word MVP wrote:
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/show...?Number=249902

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Code in a mailmerge template Dixie Mailmerge 3 November 25th 05 06:35 AM
Word Mailmerge with Access via DDE Jim Gilligan Mailmerge 0 November 22nd 05 01:21 PM
Trying to suppress Select Table box in Excel-Word mailmerge Denise Mailmerge 4 June 21st 05 01:08 PM
Protect mailmerge document BillM Mailmerge 1 June 9th 05 12:58 PM
Included Property in Word 2003 MailMerge Alessio Mailmerge 1 December 23rd 04 11:26 AM


All times are GMT +1. The time now is 05:48 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"