Hi All --
Please bear with me as I was given this task and have NEVER done this before.
I need to create a User Defined Function to calculate the business hours between 2 dates and times.
I will need to pass 5 parameters.
The parameters are:
1) Company (I have different companies with different business hours)
2) Business Hours Start (This is the time the company considers the start of it's business day. (i.e. 7:00 AM))
3) Business Hours End (This is the time the company considers the end of it's business day.(i.e. 10:00 PM, 22:00))
4) Incident Start (This would be the start of the problem being tracked. (i.e. 11/6/2009 9:00:00)
5) Incident End (This would be the end of the problem being tracked. (i.e. 11/10/2009 20:00:00)
Weekend and holidays need to be excluded. I do have a table set up with company holidays.
After much searching I did find this question that seem very close to what I am trying to accomplish, however it uses stored procedure plus a user defined function and I'm not sure how to turn it into what I actually need.
Thanks in advance for any help you can provide. Details would be appreciated.