#1
|
|||
|
|||
CREATEDATE-1 gives wrong date.
Hi All,
I have a Word Template that uses the CREATEDATE \@ "dd/MM/yyyy" \* MERGEFORMAT field code. I also have { Quote “1.{={CreateDate \@ "M"-1}.2000” \@MMM} which is supposed to subtract 1 from the creation date (MMM format) and put it alongside other text (e.g. xxx Total Monthly Cash Income, where xxx should be current month -1). As an example in Dec 2020, I got Nov Total Monthly Cash Income,when the document was created on the 15/12/2020. I create a new document on the 5/1/21, and I got Jan Total Monthly Cash Income, it should have been Dec. Can anyone explain why this is not working as anticipated? Basically, the month to be prefixed before the wording Total Monthly Cash Income, should always be the previous month. Had no problem from mid year 2020 onwards (when the template was created). Any help offered will be appreciated. |
#2
|
|||
|
|||
Your field is likely to cause problems. It should not give December as a result when used on a document created in January.
1-1=0, not 12 The CreateDate field is linked to the creation date of the document according to Word's methods. See Using Date Fields in Microsoft Word. For fields handling date calculations, see Paul Edstein's tutorial document. It has fields you can copy and paste into your documents. Be sure to read all the introductory material before trying to use one. The tutorial is a pinned thread in this forum. This tutorial has helped many people and the fields in it have been field tested. Microsoft Word Date Calculation Tutorial After reading the introductory material, look at the field on Page 7. |
#3
|
|||
|
|||
Charles,
Thanks you for your kind assistance. In the end I used Code:
{QUOTE{=MOD({DATE \@ M}+10,12)+1}/0 \@ MMMM} For anyone else who may be interested Code:
For this month: {DATE \@ MMMM} For next month: {QUOTE{=MOD({DATE \@ M}+12,12)+1}/0 \@ MMMM} For last month: {QUOTE{=MOD({DATE \@ M}+10,12)+1}/0 \@ MMMM} To get just the 3 letter code for the month, replay MMMM with MMM |
#4
|
|||
|
|||
Thank you. I will stick with Paul's fields, myself.
|
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Date is displayed in the wrong format | shawn.low@cox.net | Mail Merge | 1 | 12-28-2019 02:17 AM |
Field for date that I run the mail merge; not Date nor CreateDate | GregL | Mail Merge | 13 | 12-20-2018 12:08 AM |
Office 2016 for Mac keeps getting the wrong date for the automatic date | susanto_tm | Word | 10 | 11-05-2018 05:41 AM |
My file dates are wrong, can I use the date inside Word? | Jesperben | Word | 2 | 07-16-2016 03:49 AM |
Wrong date with CreateDate | Blablub | Word | 0 | 02-18-2010 04:20 AM |