Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 01-05-2012, 02:56 PM
macropod's Avatar
macropod macropod is offline 30+ days Variable Day Date Calculations via Fields Windows 7 64bit 30+ days Variable Day Date Calculations via Fields Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,518
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Dan,

The field coding works correctly for me. I suspect that your issue is that you're trying to generate output in a DD-MM-YYYY format whereas your system's regional settings are configured for MM-DD-YYYY. The need to modify the field codes for different regional settings is explained in the tutorial's Introduction.

That aside, I'd suggest encoding the field as:
Code:
{QUOTE
{SET StartDate {REF substantialcomplete}}
{SET Delay {REF scopechangeday1}}
{SET a{=INT((14-{StartDate \@ M})/12)}}
{SET b{={StartDate \@ yyyy}+4800-a}}
{SET c{={StartDate \@ M}+12*a-3}}
{SET d{StartDate \@ d}}
{SET jd{=d+INT((153*c+2)/5)+365*b+INT(b/4)-INT(b/100)+INT(b/400)-32045+Delay}}
{SET e{=INT((4*(jd+32044)+3)/146097)}}
{SET f{=jd+32044-INT(146097*e/4)}}
{SET g{=INT((4*f+3)/1461)}}
{SET h{=f-INT(1461*g/4)}}
{SET i{=INT((5*h+2)/153)}}
{SET dd{=h-INT((153*i+2)/5)+1}}
{SET mm{=i+3-12*INT(i/10)}}
{SET yy{=100*e+g-4800+INT(i/10)}}
"{dd}-{mm}-{yy}" \@ "d MMMM yyyy"}
As per the tutorial's 'Date and Time Calculations In A Word Form' topic. And, as per the tutorial's Introduction, you may need to swap the '{dd}-{mm}' portion of the field coding around.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

Tags
field day date



Similar Threads
Thread Thread Starter Forum Replies Last Post
30+ days Variable Day Date Calculations via Fields How do I get auto-updated "number of days since specified date" on MS word? terry795 Word 16 01-07-2016 04:33 PM
Variable fields? Emalee77 PowerPoint 0 01-30-2011 05:58 PM
Creating an Auto-Calc'd Date? Today+7 Days? SoCalTelephone Word 0 10-06-2010 10:27 AM
how to make fields calculation variable according to the filter i use duraid Project 0 09-09-2010 01:05 PM
Calculations using values from date picker controls Inkarnate Word 0 06-09-2010 07:16 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:33 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