Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-21-2016, 01:40 PM
neon4 neon4 is offline Date field - future date calculation + only business days Windows 10 Date field - future date calculation + only business days Office 2003
Novice
Date field - future date calculation + only business days
 
Join Date: Jan 2016
Posts: 4
neon4 is on a distinguished road
Default Date field - future date calculation + only business days

Hello people,
I need help with the date field to calculate a future date and that it would skip weekends and holidays.

I was reading through several forums and tutorials and found out that it's surprisingly complex.

I have no idea how to make this.

The idea is as follows:
Today's date = January 21, 2016
- I need the date to be 3 days in the future while excluding the weekend and let's imagine that there is also a holiday on Monday next week.

The calculated date then would be January 27, 2016


- of course the code in the field would have to take into account the number of days in each month to smoothly go to the next month.

The date would be calculated each time the document is opened.

From what I've seen so far I understand that such thing is quite complex and I'm not even sure it works this way.

Is there anyone who could help me with this?
The best would be if someone attached a word document with this field already coded and I would just save it to copy it in all the documents.

Thanks in advance for any ideas
Reply With Quote
  #2  
Old 01-21-2016, 01:43 PM
macropod's Avatar
macropod macropod is offline Date field - future date calculation + only business days Windows 7 64bit Date field - future date calculation + only business days Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

To see how to do this and just about everything else you might want to do with dates in Word, check out my Microsoft Word Date Calculation Tutorial, at:
http://windowssecrets.com/forums/sho...ation-Tutorial
or:
http://www.gmayor.com/downloads.htm#Third_party
In particular, look at the item titled Handling Weekends and Holidays in Calculated Dates. Do read the document's introductory material.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 01-21-2016, 01:53 PM
neon4 neon4 is offline Date field - future date calculation + only business days Windows 10 Date field - future date calculation + only business days Office 2003
Novice
Date field - future date calculation + only business days
 
Join Date: Jan 2016
Posts: 4
neon4 is on a distinguished road
Default

Hi,
Thank you for the prompt reply.

I have read these tutorials and articles but I just can't get it to work. To be honest I have no idea how to properly modify the code. I spent a few hours on it and with no satisfactory results.

I was just thinking if it would be possible to create the field with the requirements from my original post included and post it here?
Reply With Quote
  #4  
Old 01-21-2016, 02:02 PM
macropod's Avatar
macropod macropod is offline Date field - future date calculation + only business days Windows 7 64bit Date field - future date calculation + only business days Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

Quote:
Originally Posted by neon4 View Post
I was just thinking if it would be possible to create the field with the requirements from my original post included and post it here?
The tutorial already contains fully-working field codes. All you need do is copy the 'Following Monday' version and change the 'Delay' value to 3. Hardly a task that warrants me doing the work for you...
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 01-21-2016, 02:11 PM
Charles Kenyon Charles Kenyon is online now Date field - future date calculation + only business days Windows 8 Date field - future date calculation + only business days Office 2013
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,082
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Quote:
Originally Posted by neon4 View Post
Hi,
***
I was just thinking if it would be possible to create the field with the requirements from my original post included and post it here?
Paul has already given you the tools and a tremendous amount of work. If this is important for you, take the time to learn it or hire some high school kid to put it together for you. That tutorial is the bible on doing date calculations and, yes, it does take some thought and some work.

Just play around with it and you'll be surprised at what you can do. This is a user-to-user support forum to give people assistance. It is structured on the idea of giving someone a fishing pole and teaching them to fish rather than catching the fish for them.
Reply With Quote
  #6  
Old 01-21-2016, 02:16 PM
neon4 neon4 is offline Date field - future date calculation + only business days Windows 10 Date field - future date calculation + only business days Office 2010 32bit
Novice
Date field - future date calculation + only business days
 
Join Date: Jan 2016
Posts: 4
neon4 is on a distinguished road
Default

You wouldn't believe it but it doesn't change anything. I also tried modifying the date format to be just Month day, year but the thing just stays the same.

What exactly does the QUOTE command does in the code? Is there something that needs to be connected missing?
Reply With Quote
  #7  
Old 01-21-2016, 02:20 PM
neon4 neon4 is offline Date field - future date calculation + only business days Windows 10 Date field - future date calculation + only business days Office 2010 32bit
Novice
Date field - future date calculation + only business days
 
Join Date: Jan 2016
Posts: 4
neon4 is on a distinguished road
Default

Quote:
Originally Posted by Charles Kenyon View Post
Paul has already given you the tools and a tremendous amount of work. If this is important for you, take the time to learn it or hire some high school kid to put it together for you. That tutorial is the bible on doing date calculations and, yes, it does take some thought and some work.

Just play around with it and you'll be surprised at what you can do. This is a user-to-user support forum to give people assistance. It is structured on the idea of giving someone a fishing pole and teaching them to fish rather than catching the fish for them.
Alright, I understand now.

Thanks for guiding me and for providing the links.

Please close the thread. I got the answer
Reply With Quote
  #8  
Old 01-21-2016, 02:21 PM
macropod's Avatar
macropod macropod is offline Date field - future date calculation + only business days Windows 7 64bit Date field - future date calculation + only business days Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

Quote:
Originally Posted by neon4 View Post
You wouldn't believe it but it doesn't change anything. I also tried modifying the date format to be just Month day, year but the thing just stays the same.
Did you update the field after making the change?
Quote:
Originally Posted by neon4 View Post
What exactly does the QUOTE command does in the code?
It serves as a wrapper to ensure the others update as a group. It would be no good to update just one of the fields in the construction. It also provides the context for the switches that format the output.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel pivot table with a DATE value field for some reason stops at a certain date angie450 Excel Programming 2 08-19-2014 08:50 AM
Adding text before a date merge field AND fomatting date as well NikkiR Mail Merge 1 08-06-2014 07:18 PM
Date field inserting merge date in blank field Lesley Mail Merge 5 09-30-2013 01:49 AM
Date field - future date calculation + only business days VBA code for inserting a future date cosmopolitan Word VBA 1 08-14-2013 01:58 PM
Date field - future date calculation + only business days Date Field to add 10 Days to Current Date Erbwon Word 6 11-12-2012 06:17 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:00 AM.


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