troubleshooting Question

Create a SQL function to calculate "datediff" based on hours of operation

Avatar of socan
socan asked on
9 Comments4 Solutions992 ViewsLast Modified:
We have a helpdesk ticketing software database on a SQL 2000 server. We are trying to query to see if an SLA has passed based on the priority of the ticket, but we want this calculation based on 7am - 7 pm Mon - Fri. We were thinking we would have to create a function for this, but don't know how to go about it. Any ideas?

example: a call is logged on wednesday at 6pm and is resolved on thursday at 8:00am the difference shoudl be 2 hours, not 14. If the priority was a 2 (4 hour SLA) then the SLA would be met.

example 2: a call was logged on friday at 2pm and resolved on monday at 10am. Priority 3 is one business day, so it should be met.

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 4 Answers and 9 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 4 Answers and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros