• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 481
  • Last Modified:

Using Date Merge fields in Word to calculate a date 28 days from the Invoice date

Hi,
Using Date Merge fields in Word (Invoice Date) - is it possible to calculate a date 28 days from the date of the invoice to state that this is the due date?
(It is not feasible at the moment to have this field added to the database)

Thanks,
Regards,
RD
0
RDesigns
Asked:
RDesigns
2 Solutions
 
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
Hello,

it is certainly possible to add a specific number of days to a date field in Word, but it's not trivial.

Attached is a Word document that explains just about any date manipulation that you may want to do on a date field in Word. It has been created by Paul Edstein, a Word MVP who posts under the handle Macropod on the web.

cheers, teylyn


DateCalc-V2-85.doc
0
 
GrahamSkanRetiredCommented:
It is possible, but very difficult. Here is an example of adding 14 days to the document's CreatDate value

{ QUOTE "{ SET " Delay" "14" }
{  SET "DaysInMonth" { IF { CreateDate \@ "MM" } <> 2
{  = ROUND(30.575*{ CreateDate \@ "MM" },0)-
ROUND(30.575*{ = { CreateDate \@ "MM" } -1 },0) }
{  IF {  = MOD( { CreateDate \@"yy" } , 4 ) } > 0 "28" "29" } } }
{ SET "NextMonth" {  IF {  CreateDate \@ "MM" } = 12 "1/97"
"{ = {  CreateDate \@ "MM" } + 1 }/97 } }
{  IF {   = {  REF "Delay" } + { CreateDate \@ "dd" } } <= { REF"DaysInMonth" }
{ CreateDate \@ "MMMM { = {  REF "Delay" } + { CreateDate \@ "dd" } }, yyyy"}{ QUOTE { NextMonth \@ "MMMM" }
{ = { REF "Delay" } + { CreateDate \@ "dd" } - { REF"DaysInMonth" } },
{ IF { CreateDate \@ "MM" } <> 12 { CreateDate \@ "yyyy" }
{ CreateDate \@ "{ = 1 + { CreateDate \@ "yyyy" } \# "xxxx" }" } } } }" }

It is from this page:
http://addbalance.com/word/datefields2.htm

If it is administratively difficult to change the database, you could create query or an intermediate source and with the extra column.


0
 
RDesignsAuthor Commented:
Thank you for your help, however may have to rethink the approach
Regards,
RD
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now