Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-09-2021, 09:37 AM
PM1 PM1 is offline CREATEDATE-1 gives wrong date. Windows 10 CREATEDATE-1 gives wrong date. Office 2013
Novice
CREATEDATE-1 gives wrong date.
 
Join Date: Sep 2020
Posts: 8
PM1 is on a distinguished road
Default 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.

Reply With Quote
  #2  
Old 01-09-2021, 11:09 AM
Charles Kenyon Charles Kenyon is offline CREATEDATE-1 gives wrong date. Windows 10 CREATEDATE-1 gives wrong date. Office 2019
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 7,103
Charles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to behold
Default

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.


Reply With Quote
  #3  
Old 01-10-2021, 06:26 AM
PM1 PM1 is offline CREATEDATE-1 gives wrong date. Windows 10 CREATEDATE-1 gives wrong date. Office 2013
Novice
CREATEDATE-1 gives wrong date.
 
Join Date: Sep 2020
Posts: 8
PM1 is on a distinguished road
Default

Charles,

Thanks you for your kind assistance.

In the end I used
Code:
{QUOTE{=MOD({DATE \@ M}+10,12)+1}/0 \@ MMMM}
to fullfill my requirement.



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
Reply With Quote
  #4  
Old 01-11-2021, 11:52 AM
Charles Kenyon Charles Kenyon is offline CREATEDATE-1 gives wrong date. Windows 10 CREATEDATE-1 gives wrong date. Office 2019
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 7,103
Charles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to behold
Default

Thank you. I will stick with Paul's fields, myself.
Reply With Quote
Reply

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
CREATEDATE-1 gives wrong date. Field for date that I run the mail merge; not Date nor CreateDate GregL Mail Merge 13 12-20-2018 12:08 AM
CREATEDATE-1 gives wrong date. Office 2016 for Mac keeps getting the wrong date for the automatic date susanto_tm Word 10 11-05-2018 05:41 AM
CREATEDATE-1 gives wrong date. 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

Other Forums: Access Forums - Senior Forums

All times are GMT -7. The time now is 05:07 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2021 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft