Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-29-2012, 04:13 PM
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,467
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

What are DATE1 & DATE2? mergefields? formfield bookmarks? What regional date/time setting are you using? Do you have other fields in the document (eg for date calculation) that use the same bookmark names that the above field uses (see the SET fields)?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #2  
Old 05-30-2012, 02:10 AM
Fields Fields is offline Complex date comparison/Selection using fields instead of VBA Windows XP Complex date comparison/Selection using fields instead of VBA Office 2003
Novice
Complex date comparison/Selection using fields instead of VBA
 
Join Date: May 2012
Posts: 5
Fields is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
What are DATE1 & DATE2? mergefields? formfield bookmarks? What regional date/time setting are you using? Do you have other fields in the document (eg for date calculation) that use the same bookmark names that the above field uses (see the SET fields)?
I have tried the following combinations for Date1 & Date2:
Both as fill-in formfield bookmarks (as standard text type and also as fixed dd/MM/yyyy Date types).
Date1 as formfield bookmark and Date2 as a { SET Date2 ... } parameter type.
All give the same results.

Regional settings should be either English/Uk or English/Ireland, but the workstation is locked down so I can't confirm that. All dates in the system, windows, and Word/Excel etc default to dd/MM/yyyy which would support the assumption, however.

There are 3 other calculations in the same document which re-use the "+n days" calculation, so they repeat the same bookmarks. These all work correctly, and reference the same Date1 Date2 bookmark information. I have copied the code above to a new blank document and recreated the fields, but the results are still the same.

If I quote out the result bookmarks, I get:
dd = "6"
mm = "-22"
yy = "2014"
so it does not look like the error is part of the formatting switch.


I tried retyping the code more than once, and tried copying the field codes directly from the Date Calculation doc to eliminate the possibility that I typed it incorrectly, but still got the same error. Having said that, I've just tried doing it in the blank document and I am getting the correct result!

Headwrecker!
Reply With Quote
Reply

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 02:19 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