I am trying to implement Ken Hamady's Business Hours Formula and I have run into a problem. I am a member of a reporting team that is over a Call Center. My {Start.Time} is the create date/time of a ticket and my {End.Time} is the date/time the ticket was resolved. This is a 24hr call center so tickets are being created and resolved around the clock. Most of our fix agents(people who resolve the tickets) only work 9-5. It seems the formula works great except when a ticket was created or resolved outside of the fix agents business hours. The formula returns a negative value. For example I have a ticket that was created on 08/20/01 7:40:08AM and Resolved 08/20/01 9:41:03AM. The business day(from Ken's Business Days Formula) shows correctly as 1 day however the Business Hours shows -21.98. I am using Crystal Reports 8.0 Developer Edition. Please let me know if I need to provide any additional information.
//Business Hours Formula
WhilePrintingRecords;
NumberVar Days := {@Business Days Formula}; // The field that calculates your business days
TimeVar SetStart := TimeValue( "8:00" // The start your work day
TimeVar SetEnd := TimeValue("17:00" // The end your work day
TimeVar StartTime := TimeValue({Start.Time});// The data field that holds your Start Time
TimeVar EndTime := TimeValue({End.Time}); // The data field that holds your End Time
Days * ((SetEnd - SetStart) / 3600)
- ((SetEnd - EndTime) / 3600)
- ((StartTime - SetStart) / 3600)
//Business Hours Formula
WhilePrintingRecords;
NumberVar Days := {@Business Days Formula}; // The field that calculates your business days
TimeVar SetStart := TimeValue( "8:00" // The start your work day
TimeVar SetEnd := TimeValue("17:00" // The end your work day
TimeVar StartTime := TimeValue({Start.Time});// The data field that holds your Start Time
TimeVar EndTime := TimeValue({End.Time}); // The data field that holds your End Time
Days * ((SetEnd - SetStart) / 3600)
- ((SetEnd - EndTime) / 3600)
- ((StartTime - SetStart) / 3600)