Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Chris Stammers Chris Stammers is offline
external usenet poster
 
Posts: 46
Default Future Dates - Again!

Hello,

I have this code which was given to me before however the date field I am
trying to calculate from is formatted in our AS400 as 28th May 2008, so is a
full date without day, but including ordinals. My question is this: how do I
amend this code to allow for the format of the original field, in this case,
the AS400 field would be placed in a document as { MERGEFIELD YYYCZ1 }. The
code I have is below.

Many thanks.

Regards,
Chris

{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"}

 
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
Can Word automatically send reminders on specific future dates? eyedrequired Microsoft Word Help 3 March 13th 08 06:24 AM
Can Word automatically send reminders on specific future dates eyedrequired Microsoft Word Help 2 March 13th 08 06: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
Windows explorer dates to match Word dates John Microsoft Word Help 0 October 17th 05 11:43 PM


All times are GMT +1. The time now is 09:32 AM.

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"