Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 05-29-2012, 06:14 AM
macropod's Avatar
macropod macropod is offline Complex date comparison/Selection using fields instead of VBA Windows 7 64bit Complex date comparison/Selection using fields instead of VBA Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,344
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

Try:
Code:
{QUOTE
{SET Delay 28}
{SET a{=INT((14-{DATE1 \@ M})/12)}}
{SET b{={DATE1 \@ yyyy}+4800-a}}
{SET c{={DATE1 \@ M}+12*a-3}}
{SET d{DATE1 \@ 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)}}
{IF{DATE2 \@ "YYYYMMDD"}<{QUOTE "{dd}-{mm}-{yy}" \@ "YYYYMMDD"} {DATE2 \@ "dddd, d MMMM yyyy"}{QUOTE "{dd}-{mm}-{yy}" \@ "dddd, d MMMM yyyy"}}}
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

Tags
arrrgh, date fields mathematics, macropod



Similar Threads
Thread Thread Starter Forum Replies Last Post
Date Fields ubns Word 8 05-15-2012 11:20 PM
Saving & reopening comparison MarshallAbrams Word 0 03-29-2012 06:19 AM
Comparison jumps to end MarshallAbrams Word 2 03-21-2012 04:04 AM
Complex date comparison/Selection using fields instead of VBA Complex array formula andrei Excel 9 02-03-2012 03:40 AM
30+ days Variable Day Date Calculations via Fields ztag Word 2 01-06-2012 11:12 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:46 AM.


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