Unable to get field formula to work

L

Lee

I'm trying to create a formula that will present the date 15 days from
today's date. This is what I have { DATE+15 \@ "MM/DD/YY" } but I get this
result !Undefined Bookmark, DATE. I'm wanting to write a letter to a customer
letting them know their payment is overdue and tell them what date they have
to pay by. I want the "due date" to automatically calculate 15 days from
"today's" date (ie: the date that I'm writing the letter).
 
C

Charles Kenyon

This is more complex than you might imagine, but it can be done. See
http://addbalance.com/word/datefields2.htm for information on the different
kinds of ways to make a date calculation work. It includes links to pages
with fields and an explanation of different macros that can be used instead
of fields.

--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide


--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
L

Lee

Hi Macropod,

I love your document and I know it's going to give me the result I am
looking for, but because (I assume) you are Australian the language in the
document is English (Aust.). I changed the language to English (US) but the
calculations are still coming out wrong. Instead of the "result" being Feb
10 2006, it's showing as Oct 2 2006.
Australian for Feb 10 2006 is 10/2/06
American for Feb 10 2006 is 2/10/06
How can I correct this to work for me?
 
G

Graham Mayor

The formulae should not be dependent on language and the results are
controlled by the switch at the end thus

{QUOTE{SET Delay 15}{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*10^6+mm*10^4+yy
\# "00'-'00'-'0000"} \@ "MM/dd/yy"}

However there have been some date transposition issues with some versions of
Words that were fixed by updates. Check that you have the latest updates for
your Word version.

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
M

macropod

Hi Lee,

On page 1 of the document is a section named "Date input/output formats".
This tells you how to edit the field to work with your regional settings.

Cheers
 
Top