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!

Count Hours

Status
Not open for further replies.

Edie0802

Programmer
Jul 11, 2003
68
US
I have tried many of the tips in this forum from other users with this same problem and my numbers aren't coming out right.

I need to calculate the hours from the time a trouble ticket is open until the trouble ticket is closed. Very often, the ticket is closed within an hour of opening. Sometimes it can span many days.

I need to exclude weekends. I also need to exclude non-business hours. Our working hours are from 0730 to 1630.

I have already tried the formulas in to no avail.

I am using DateTime format, for example, 11/12/95 2:58:17 PM.

Thanks.
 
If I had the time I would build the formula, so let me apologize in advance for the following answer:

The short answer is that you will need to build a dynamic array consisting of the each “date time” with in the range of the beginning “date time” to the ending “date time” field. Then evaluate each array element and assign an hour value for each element in the array. If the array element is a full day then give it 8 hours, If it is a week end give it 0 hours, for partial days (< 24 Hours) just give it the hours with in that period. This is where I would start if I were approaching the issue.
 
Thank you for the idea. However, I finally figured it out myself and will gladly post the whole solution if anyone is interested.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top