That's because you're formating it for display as time (the fraction of a day) which it isn't. The difference between created and closed for ID 10001 is fifteen minutes, that's 1/4th of an hour or 0.25 hour. That is the value that is calculated. However, by formatting it as time you get it as 0.25 days which displays as 6 hours and 0 minutes: 6:00
Hi, thanks that sort of works, the only thing that is wrong now is that if a call is opened on the 1st of the month and closed on the 26th month, the days taken is being reported as 25. but its actually only about 17 as weekends should not be included.
Do you know how i can resolve this? in the script i have a 'Schedule' containing times for weekdays and weekends. Would i also need days?
I think you should split the Datetimes in a date and a time field. Then you can simply use the networkdays function to calculate the number of work days between the creation and closing dates: networkdays(CreateDate, CloseDate). If you have dates for holidays available you can add those as additional arguments to the networkdays function.
And you can substract the times to get the hours and minutes with something like if(CloseTime<CreateTime, CloseTime - (CreateTime - 8), CloseTime - CreateTime)