Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Code in a mailmerge template | Mailmerge | |||
Word Mailmerge with Access via DDE | Mailmerge | |||
Trying to suppress Select Table box in Excel-Word mailmerge | Mailmerge | |||
Protect mailmerge document | Mailmerge | |||
Included Property in Word 2003 MailMerge | Mailmerge |