Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 04-04-2020, 03:22 PM
eduzs eduzs is offline Advanced field coding, given date instead of today. Windows 10 Advanced field coding, given date instead of today. Office 2019
Expert
Advanced field coding, given date instead of today.
 
Join Date: May 2017
Posts: 266
eduzs is on a distinguished road
Default Advanced field coding, given date instead of today.

I have this field code that works fine:



Code:
{ SET xM{ = { DOCVARIABLE dt1 \@ M}} }{ SET xMM{ = { DOCVARIABLE dt1 \@ MM}} }{ SET xY{ = { DOCVARIABLE dt1 \@ yyyy}} }

{ QUOTE { SET Delay 1 } { SET m { =MOD({ xMM }+Delay+11;12)+1 } }{ SET y { =INT({ xY }+(Delay+{ xM }-1)/12) } } “{ m }-{ y }” \@ “MMMM/yyyy” }
But I want to define a variable to repeat the field elsewhere in the document, saving space / lines (no need to repeat this long field code).

I tried this:

Code:
{ SET xDate{={ QUOTE { SET Delay 1 } { SET m { =MOD({ xMM }+Delay+11;12)+1 } }{ SET y { =INT({ xY }+(Delay+{ xM }-1)/12) } } “{ m }-{ y }” \@ “MMMM/yyyy” }}}
{ xDate \@ “MMMM/yyyy” }
But this returns an error: unexpected end of formula.

Thanks in advance
__________________
Backup your original file before doing any modification.

Last edited by eduzs; 04-04-2020 at 05:58 PM.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Change font color if date in column F is prior to today's date. kevinbradley57 Excel Programming 1 12-05-2018 07:35 PM
Advanced field coding, given date instead of today. Nested If Statements in Formula Field to Produce the Diffrnc in Years Between Today's & Entered Date mshu31 Word 1 02-09-2017 02:04 PM
Advanced field coding, given date instead of today. Today's Date Function freschij Excel 3 02-11-2011 10:21 AM
new appointment date always reverts back to today's date msills Outlook 0 08-24-2007 08:57 AM
Advanced field coding, given date instead of today. Imported message date change to today's date promark Outlook 1 12-23-2005 07:21 AM

Other Forums: Access Forums

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


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