× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: Calculating Working(business) days
  • From: Jim Langston <jlangston@xxxxxxxxxxxxxxxx>
  • Date: Wed, 23 Aug 2000 16:06:42 -0700

That should be a simple subroutine/service program.

Very simple to do.  You determine how many business days left for be beginning 
week,
how many left for the ending week, and how many inbetween.

Say the dates are August 23 (Wednesday) to September 21st (Thursday).

First, there are 3 business days inclusive left this week (Wed, Thr and Fri).
Second, there are 4 business days inclusive the last week (Mon, Tue, Wed, Thu).

There are 30 days inclusive between the dates (EndDate - StartDate) + 1.
Take off the days in the weeks we have already calculated.  4 days for the 
first week
(Wed, Thr, Fri and Sat) and 5 days for the last week (Sun, Mon, Tue, Wed, Thr).
30 - 9 = 21.  21 / 7 = 3.  3 full weeks.  3 * 5 (5 working days each week) = 15.

So, 3 + 4 + 15 = 22 working days between Aug 23 and Sep 21.

This is the type of thing I would write a subroutine for, get it all working 
perfectly,
then stick it in a service program.  Even though you may only have to call it 
once or
twice it's somethign you don't want to have to maintain more than once.

Say you decide to exclude holidays, etc..  Just change it in one spot.



oludare wrote:

> Hi guys,
>
> Is there a tool or utility that can be use to calculate a date from a given
> date with a duration of 'n' business days (Mon-Fri).
> (assume no holidays)
>
> Dare

+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.