Merge to NewDoc mergedate vs print date

J

JeffP->

I'm looking for a document level way to merge to a new doc and have the date
be that date rather than the print date, in otherwords, I want to merge on
Tuesday, print on Wed. and retain the tuesday merge date.

I could put a print date in my Excel database, but I thought perhaps there
was an easy way to render the result of the field rather than a dynamic date
value.

I initially used {Date \@"MMMM dd, yyyy"} and then {={Date \I} \@"MMMM dd,
yyyy"}. The later renders the merged date in the new doc, but printing
updates the date value.

TIA
 
D

Doug Robbins - Word MVP

You should enter Tuesday's date into the mail merge main document. That is
the date that will then appear in the documents that are created by
executing the merge and it will not change from that date.

Neither the createdate nor savedate fields survive the execution of a
mailmerge, so if either of them return the desired date, they could also be
used in the mail merge main document.

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

Graham Mayor

Date fields in merges create an interesting dilemma

A DATE field will re retained across the merge and always updated
A CREATEDATE field will be fixed but it will always display the date the
merge document was created (you can recreate the date with SAVEAS and save
with the same name)

A calculated date can be rather complicated to attain - see below

{QUOTE
{SET Delay 0}
{SET a{=INT((14-{DATE \@ M})/12)}}
{SET b{={DATE \@ yyyy}+4800-a}}
{SET c{={DATE \@ M}+12*a-3}}
{SET d{DATE \@ d}}
{SET
jd{=d+INT((153*c+2)/5)+365*b+INT(b/4)-INT(b/100)+INT(b/400)-32045+Delay}}
{SET e{=INT((4*(jd+32044)+3)/146097)}}
{SET f{=jd+32044-INT(146097*e/4)}}
{SET g{=INT((4*f+3)/1461)}}
{SET h{=f-INT(1461*g/4)}}
{SET i{=INT((5*h+2)/153)}}
{SET dd{=h-INT((153*i+2)/5)+1}}
{SET mm{=i+3-12*INT(i/10)}}
{SET yy{=100*e+g-4800+INT(i/10)}}
"{dd}-{mm}-{yy}" \@ "d MMM yyyy"}

but it does fix the date to that of the merge. The above will insert the
date of the merge as plain text. You can vary that date by setting the delay
thus a delay of 1 will give you tomorrow's date and a delay of -1 will give
you yesterday's date.

Don't even think of copying the above from this message. Instead, see
macropod's remarkable work on date fields which you can download from the
link at http://www.gmayor.com/insert_a_date_other_than_today.htm
 
G

Graham Mayor

That's much simpler of course than the calculated date if you want to show
the date the merge took place.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
J

JeffP->

Thanks Peter for the d&d - most similar to my {={Date}}
And Graham, I always like those adjustable dates, in fact if the increment
were a variable result from a merge field, I could dynamically adjust my
dates as my business processes needed. Sometimes I like a recent printdate to
reflect a prompt response, other times due to packaging I want a delay so
that it doesn't appear too dated when a client receives our correspondence....
 
G

Graham Mayor

I see no reason why you could not select the delay from a field in your
merge data eg remove the SET Delay field and insert the Mergefield where the
Delay is used e.g.

{QUOTE
{SET a{=INT((14-{DATE \@ M})/12)}}
{SET b{={DATE \@ yyyy}+4800-a}}
{SET c{={DATE \@ M}+12*a-3}}
{SET d{DATE \@ d}}
{SET jd{=d+INT((153*c+2)/5)+365*b+INT(b/4)-INT(b/100)+INT(b/400)-32045+{
Mergefield Delay }}}
{SET e{=INT((4*(jd+32044)+3)/146097)}}
{SET f{=jd+32044-INT(146097*e/4)}}
{SET g{=INT((4*f+3)/1461)}}
{SET h{=f-INT(1461*g/4)}}
{SET i{=INT((5*h+2)/153)}}
{SET dd{=h-INT((153*i+2)/5)+1}}
{SET mm{=i+3-12*INT(i/10)}}
{SET yy{=100*e+g-4800+INT(i/10)}}
"{dd}-{mm}-{yy}" \@ "dddd, d MMMM yyyy"}

or if the date is in your data and you want to add a delay to that retain
the Set Delay field and replace the DATE field with your Mergefield eg

{QUOTE
{SET Delay 2}
{SET a{=INT((14-{MERGEFIELD DATEFIELDNAME \@ M})/12)}}
{SET b{={MERGEFIELD DATEFIELDNAME \@ yyyy}+4800-a}}
{SET c{={MERGEFIELD DATEFIELDNAME \@ M}+12*a-3}}
{SET d{MERGEFIELD DATEFIELDNAME \@ d}}
{SET jd{=d+INT((153*c+2)/5)+365*b+INT(b/4)-INT(b/100)+INT(b/400)-32045+{ REF
Delay }}}
{SET e{=INT((4*(jd+32044)+3)/146097)}}
{SET f{=jd+32044-INT(146097*e/4)}}
{SET g{=INT((4*f+3)/1461)}}
{SET h{=f-INT(1461*g/4)}}
{SET i{=INT((5*h+2)/153)}}
{SET dd{=h-INT((153*i+2)/5)+1}}
{SET mm{=i+3-12*INT(i/10)}}
{SET yy{=100*e+g-4800+INT(i/10)}}
"{dd}-{mm}-{yy}" \@ "dddd, d MMMM yyyy"}

or even a combination of both.
 

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