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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

working hours

Status
Not open for further replies.

koune

Programmer
Oct 1, 2001
7
NL
I need to calculate within working hours, maybe it's better to use an example...

Suppose I want to calculate the number of minutes between the moment and call you and the
moment you call me back (helpdesk). But I only want to add the minutes of the working days, so:

Workingdays are: Mon-Fri 08:30 - 17:00
I call you: thursday 04-oct-2001 at 09h30
You call me back: monday 08-oct-2001 at 11h15.

Then the number of minutes before you respond is:
thursday: 17:00 minus 09:30 --> 7,5x60 = 450
friday: 17:00 minus 08:30 --> 8,5x60 = 510
monday: 11:15 minus 08:30 --> 2.75x60 = 165

Total = 450+510+165 = 1125

How do you calculate this in BO?
 
Have you looked at the functions DayName, DayNumberOfWeek, and DaysBetween?

=( If (DayNumberOfWeek(<Date of Call>) <6) And (<Time of Call> >'8:30' Or <Time of Call> <'17:00') Then Sum(

I stopped here because I realized there are some problems with this, but it may be close to what you need. One thing you could do is convert all <Time of Call> times during non-working hours to the next valid working hour. So if the call was received at 6:30 pm on Thursday you would change <Time of Call> to 8:30 am, Friday. Sorry if this is no help. -Stephen
 
Thanks,

So far I used the following (bit long):
1. call on mo-fr 08:30 to 16:30, then the responselimit is half an hour later
2. call on mo-vr 00:00 to 08:30, then the responsemlimit is the same day before 09:00
3. call on mo-thurs 16:30 en 17:00, then calculate diff. between 17:00 and the callmoment and add this to 08:30 the next day (that's the responselimit).
4. call on mo-thurs after 17:00, then the calllimit is the next day 09:00
5. fri between 16:30 - 17:00, then calculate diff. between 17:00 and the callmoment and add this to 08:30 three days later (monday) (that's the responselimit).
6. fr after 17:00, then responselimit is three days later (monday) 09:00
7. saturday, responselimit 2 days later 09:00
8. sunday, responselimit 1 day later 09:00


SO.....my question now is, how do I calculate these hours and create a new date??

THANKS EVERYBODY!
 
Hi

Initially I asked you to try with DayDiff through VBA.
DayDiff calulates the Hours betn 2 dates.
But this folmula is not taken for the new variable you add.

If anybody knows &quot;how to put calculated values in the local variable?&quot; will be a great help, this variable is created through vba only.

Shyam

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top