View Single Post
  #11   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson
 
Posts: n/a
Default Insert a future date

I get the impression that the problem could be that the date fields coming
across from the AS400 are not treated as dates by Word. If Word sees the
field "mydate" as a date, then Word's date switches should function, e.g. if
mydate is 13 June 2006, then

{ MERGEFIELD mydate \@YYYY }

should display as 2006,

{ MERGEFIELD mydate \@M }

should display as 6, and so on. This is crucial to the functioning of the
fields Graham describes.

If Word is not treating your AS400 dates as dates, either another approach
is needed or you need to try to get it to do so. I don't know AS400 and
don't have one to experiment with here, but
a. are the dates in something that is obviously a date field on AS400?
b. how are you connecting to the AS400? Do you use an ODBC driver or an
OLEDB provider? Do you know if the AS400 driver/provider implements a
standard dialect of SQL?

Peter Jamieson


"Chris Stammers" wrote in message
...
Hello,

I am also trying to do this (I need to add 14 days to todays date). I
picked
up a long string of code from one of the guys here which works well on its
own however, when used in a mail merge document, the code interferes with
the
merge fields and stops them working, so no letters are produced at all. We
are using Word 2000 v9.0. Does anyone have any experience of this? I
should
perhaps say that the source data is coming from an AS400 system rather
than a
created Excel or Access file.

Thanks.
Regards,
Chris

"Charles Kenyon" wrote:

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

See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!
--------- --------- --------- --------- --------- ---------
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.

"Mark Ashley" wrote in message
news
This may be a dumb question, but I can't figure out how to get Word
(2003)
to
insert a future date. For example, insert the date that is 30 days
from
the
current date.

Thanks for any help. I can't believe the time I've spent trying to
figure
this out.