Date Calculation by subtracting one day from date field using mergefield

Hi,

I have a mail merge document where it captures data from a database.

I wanted to use the date calculation to subtract one day from the date field.

Example, the date field from the database is June 6, 2014, i have to be able to come up with a date where it will show June 5, 2014 instead.

Thanks for the support in advance.

Chlea

Date calculations are complicated. See http://www.gmayor.com/insert_a_date_other_than_today.htm (you can download the example from Paul Edstein's linked file on that page, to reduce the possibility of typing errors).  Change CREATEDATE to MERGEFIELD DateFieldName and set the delay to -1

 

Graham Mayor (Microsoft Word MVP 2002-2019)
For more Word tips and downloads visit my web site
https://www.gmayor.com/Word_pages.htm

1 person found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Easier to subtract the day in a query in the data base and use the query as the data source.
Hope this helps,
Doug Robbins - MVP Office Apps & Services (Word)
dougrobbinsmvp@gmail.com
It's time to replace ‘Diversity, Equity & Inclusion’ with ‘Excellence, Opportunity & Civility’ - V Ramaswamy

1 person found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Not sure how that's 'easier' than copying & pasting the field from the tutorial's 'Date and Time Calculations In A Mailmerge' example and changing two variables...
Cheers
Paul Edstein
(Fmr MS MVP - Word)

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Hello Guys,

Thanks for the inputs.

Have tried one of the samples below;

{={ MERGEFIELD ANNIVERSARYDATE \@ "d"}-1 \* MERGEFORMAT}

The anniversary date is June 6, 2014 , so the output is 5.

I wanted to have an as June 5, 2014 instead of 5.

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Let's hope the anniversary date is never June 1 then!
Graham Mayor (Microsoft Word MVP 2002-2019)
For more Word tips and downloads visit my web site
https://www.gmayor.com/Word_pages.htm

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Your field construction has nothing in common with the field codes in my Microsoft Word Date Calculation Tutorial, which you can download from:
http://windowssecrets.com/forums/showthread.php/154368-Microsoft-Word-Date-Calculation-Tutorial
or:
http://www.gmayor.com/downloads.htm#Third_party
In particular, look at the item titled 'Date and Time Calculations In A Mailmerge'. Do read the document's introductory material.
Cheers
Paul Edstein
(Fmr MS MVP - Word)

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated November 5, 2024 Views 10,387 Applies to: