Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calculate target date - working days only

Status
Not open for further replies.

tizwaz

Technical User
Aug 8, 2002
437
GB
I have a field target date in which needs to be automatically set a number of working days after the date a call is raised. I have table with call categories
eg electrical - 3 working days
plumbing - 2 working days

When we log a call I would like the target date to be auto completed. I know I need to make a table for all public holidays and refer to that in code but not sure how to word it
 
MichaelRed has done lot of that work for you, check out faq705-3213 and faq181-261.

Roy-Vidar
 
Thanks that's useful However it seems to be set to count the number of days between 2 dates. What I need to do is calculate a date a set number of working days ahead of the start date.
 
tizwaz,

Roy said "MichaelRed has done lot of that work for you"

He did not say that ALL of the work was done.

You need logic that initializes a loop counter "counter", saves the number of days "nbrdays".

LOOP
advance a day, check for weekend/holiday - if so advance to next date without bumping "counter", if not bump "counter" and see if "counter" has advanced to "nbrdays", if so you have your date, if not, back to LOOP.

The above is an excerpt from "programming 101".

Now, look at the faq's mentioned again. Do you not see the type of logic YOU need?



HTH,
Bob [morning]
 
The second faq, counts between two dates, the first one, named "Calculating a future Workday Date", matches your description (as far as I can see it).

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top