I need a datediff function that takes office hours into account.

my office hours are
08:00 to 16:30 Monday to Thursday
with half an hour lunch 12:00 to 12:30

08:00 to 13:00 on Fridays (no lunch break)


The help desk people have a system of recording faults.

a Fault can be raised 24 hours per day

and Closed usually within office hours

are you still following this?

statisics need to be maintained on how long the fault was open for. A simple datediff will calclate this but we also want to take offce hours into account.


at the moment, if a fault is reported 14:00 on a Friday and closed 09:00 on Monday it is logged as 67 hours. We want this to be changed to 1 hour if you see what I mean.