View Single Post
 
Old 02-01-2022, 06:09 PM
macropod's Avatar
macropod macropod is offline Windows 10 Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,382
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You have a lot of strange content in your field code - extraneous double-quotes and a final line that contains some weird character strings.

Assuming the Document Issues only occur on Mondays and Thursdays, you could use a field coded as:
Code:
{QUOTE
{SET a{=INT((14-{MERGEFIELD Document_lssue_Date \@ M})/12)}}
{SET b{={MERGEFIELD Document_lssue_Date \@ yyyy}+4800-a}}
{SET c{={MERGEFIELD Document_lssue_Date \@ M}+12*a-3}}
{SET d{MERGEFIELD Document_lssue_Date \@ d}}
{SET jd{=d+INT((153*c+2)/5)+365*b+INT(b/4)-INT(b/100)+INT(b/400)-32045+18+{=MOD(jd,7)=3}}}
{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"}
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote