Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / August 2004

Tip: Looking for answers? Try searching our database.

Adding a year to a date field

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sharon - 05 Aug 2004 21:09 GMT
In my database I have a field for a filing date.  I need
to add one year to that date automatically and populate a
field in my Word document.  

Thanks.
Peter Jamieson - 05 Aug 2004 23:03 GMT
Ideally, do the addition in a query or view in your database - this is
technically possible in e.g. Access, but you may not have permission to do
it.

Otherwise, you can try the following nested fields for this one:

{ QUOTE "{ SET Y { = { MERGEFIELD mydate \@YYYY }  + 1 }
}{ SET M { MERGEFIELD mydate \@MM }
}{ SET D { MERGEFIELD mydate \@DD }
}{ IF { REF M } = "02"
"{ IF { REF D } = "29" "{ SET M "03" }{ SET D "01" }" "" }" ""
}{ REF Y }-{ REF M }-{ REF D}" \@"MMM DD, YYYY" }

All the {} need to be the special field codes you can enter using ctrl-F9.
substitute your date file name for "mydate", and substitute the date format
specification you need instead of "MMM DD, YYY"

If you need a more general-purpose routine for manipulating dates using Word
fields (and even if you don't it's probably worth checking out), I suggest
you head for macropod's excellent resource at

http://www.wopr.com/cgi-bin/w3t/showflat.pl?Cat=&Board=wrd&Number=249902

Signature

Peter Jamieson

> In my database I have a field for a filing date.  I need
> to add one year to that date automatically and populate a
> field in my Word document.
>
> Thanks.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.