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

# 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
2 Solutions

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

RetiredCommented:
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" }" } } } }" }

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

0

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

## Featured Post

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