• Incidently, I am also using this solutuion to calculate and report the duration passed for the unresolved IT HelpDesk cases at my work place. The results are displayed on an overhead dashboard for everyone to see.

    It can be used for other scenarios which requiere to calculate the time consumed in completing tasks.

    As I mentioned in the documentation

    The code can be modified to suit any other working hours and days pattern. I used this code to calculate the actual number of working hours passed since a job was started. It can be modified to calculate the number of working hours taken to complete tasks (The function CalcTimeSinceCreated will have to be modified to take two parameters in that case as 'task beginning date&time' and 'task ending date&time', instead of one at present)

    To integrate holidays in this solution you need to modify something as follows:

    1. Store all the holidays in a table Holidays (which has a field DateOff)

    2. Modify the Function 8 [CalcTimeSinceCreated] as follows:

    while (1 = 1)

    begin

    if dbo.DateAtMidnight(@VarCalcCreateDate) in (select dbo.DateAtMidnight(DateOff) from Holidays)

    set @VarCalcCreateDate = dbo.DateAt730(@VarCalcCreateDate + 1)

    I hope you manage to do the enhancement.

    Regards,

    Maz

    -----------------------------------------------------------[font=Arial Black]Time Is Money[/font][font=Arial Narrow]Calculating the Number of Business Hours Passed since a Point of Time[/url][/font][font=Arial Narrow]Calculating the Number of Business Hours Passed Between Two Points of Time[/font]