A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Mailmerge
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Adding a year to a date field



 
 
Thread Tools Display Modes
  #1  
Old August 5th, 2004, 09:09 PM
Sharon
external usenet poster
 
Posts: n/a
Default Adding a year to a date field

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.




  #2  
Old August 5th, 2004, 11:03 PM
Peter Jamieson
external usenet poster
 
Posts: n/a
Default Adding a year to a date field

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/show...&Number=249902

--
Peter Jamieson

"Sharon" wrote in message
...
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.






 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Access Calendar lost General Discussion 2 July 7th, 2004 04:58 AM
Updating a text date field? Alan D. New Users 4 June 17th, 2004 09:46 PM
more dates!!! brigid Running & Setting Up Queries 6 May 26th, 2004 10:59 AM
Stopping word from changing the document date Mike New Users 2 May 22nd, 2004 11:45 PM


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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.