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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|
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 |