Reply
 
Thread Tools Display Modes
  #1   Report Post  
emismile emismile is offline
Junior Member
 
Posts: 1
Default automatic future dates

Hi,

I have been asked to produce a letter in mail merge that has a response due date within it (2 weeks from day of printing), unfortunately the database that I am using I cannot calculate it and add it as a new field as I cannot change the date within it.

Is there any way to calculate a date based on the SentDate field that I can pull through and add 2 weeks to it?

I have tried the following two codes but neither quite work

This gives me 07-00-2016

{QUOTE{SET Delay 14}{SET a{=INT((14-{MERGEFIELD DATEFIELD \@ M})/12)}}{SET
b{={MERGEFIELD DATEFIELD \@ yyyy}+4800-a}}{SET c{={MERGEFIELD DATEFIELD \@
M}+12*a-3}}{SET d{MERGEFIELD DATEFIELD \@ 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*10^6+mm*10^4+yy
\# "00'-'00'-'0000"} \@ "dddd, d MMMM yyyy"}

This gives me August 38 2016

{ QUOTE "{ SET " Delay" "14" }
{ SET "DaysInMonth" { IF { CreateDate \@ "MM" } 2
{ = ROUND(30.575*{ CreateDate \@ "MM" },0)-
ROUND(30.575*{ = { CreateDate \@ "MM" } -1 },0) }
{ IF { = MOD( { CreateDate \@"yy" } , 4 ) } 0 "28" "29" } } }
{ SET "NextMonth" { IF { CreateDate \@ "MM" } = 12 "1/97"
"{ = { CreateDate \@ "MM" } + 1 }/97 } }
{ IF { = { REF "Delay" } + { CreateDate \@ "dd" } } = { REF"DaysInMonth" }
{ CreateDate \@ "MMMM { = { REF "Delay" } + { CreateDate \@ "dd" } }, yyyy"}{ QUOTE { NextMonth \@ "MMMM" }
{ = { REF "Delay" } + { CreateDate \@ "dd" } - { REF"DaysInMonth" } },
{ IF { CreateDate \@ "MM" } 12 { CreateDate \@ "yyyy" }
{ CreateDate \@ "{ = 1 + { CreateDate \@ "yyyy" } \# "xxxx" }" } } } }" }

Anyone spot the problem with either of them?
TIA

Emma

Last edited by emismile : August 24th 16 at 12:12 PM Reason: extra info
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
Future merge field dates Craig Mailmerge 13 January 30th 09 07:56 AM
Future Dates - Again! Chris Stammers Mailmerge 4 May 30th 08 12:48 PM
Can Word automatically send reminders on specific future dates eyedrequired Microsoft Word Help 2 March 13th 08 07:04 AM
Entering fields for future dates? meganfelicity Microsoft Word Help 2 June 27th 07 09:33 AM
How to calculate Future Dates? designgeek Microsoft Word Help 4 April 7th 06 12:43 PM


All times are GMT +1. The time now is 08:35 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"