Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good morning.
I'm trying to calculate the time spent for solving activities.
The range time is 10 AM - 6 PM.
I saw that on another topic there was a similar problem so I used the following code:
-----------------------------------------------------------------------------------------
((NetWorkDays(CREATEDDATETIME,ProcessCompleted) //FULL Working days between two dates
-IF(Frac(ProcessCompleted)<Time#('18:00','hh:mm'),1,0) //if close day isn't complete subtract 1 from Network days
-IF(Frac(CREATEDDATETIME)>Time#('10:00','hh:mm'),1,0) //if start day isn't complete subtract 1 from Network days
) * 8
+RangeMax(((Time#('18:00','hh:mm') - Frac(CREATEDDATETIME))*24),0)
+RangeMax(((Frac(ProcessCompleted) - Time#('09:00','hh:mm'))*24),0)) - (NetWorkDays(CREATEDDATETIME,ProcessCompleted))
-------------------------------------------------------------------------------------
After I turned the result(OreEffettive) in hours and minutes with the following code:
=SubField(OreEffettive,',',1)&','&subfield(left(subfield(OreEffettive,',',2),2)*60/100,',',1)
The results are correct when the date of creation or termination are between 10 AM and 6 PM, but there are errors when the creation date (or resolution) is outside this range.
example:
CREATEDDATETIME = 30/11/2012 10.44
ProcessCompleted = 30/11/2012 10:59
Resolution = 0.15 h
CREATEDDATETIME = 13/02/2013 18.11
ProcessCompleted = 13/02/2013 18.15
Resolution = 8.15 h
Can someone help me?
Best Regards.
Antonio