thank you
my function looks like this...is there anything wrong with it..
i did what you told me but it does not work..its gives me result of 0.
i know that the formula its calculating the times perfectly...
can you giveme a hand with this matter please
********************************************************************************
function result() && Function to calculate time diference
********************************************************************************
parameters hrs1, min1, sec1, hrs2, min1, sec2, timesec1, timesec2, finaltime, timediff, result
local answertime, endtime
Hrs1 = VAL(SUBSTR ( answertime, 1, 2 ))
Min1 = VAL(SUBSTR ( answertime, 3, 2 ))
Sec1 = VAL(SUBSTR ( answertime, 5, 2 ))
Hrs2 = VAL(SUBSTR ( endtime, 1, 2 ))
Min2 = VAL(SUBSTR ( endtime, 3, 2 ))
Sec2 = VAL(SUBSTR ( endtime, 5, 2 ))
Time1Sec = ( 60 * 60 * Hrs1 ) + ( 60 * Min1 ) + Sec1
Time2Sec = ( 60 * 60 * Hrs2 ) + ( 60 * Min2 ) + Sec2
TimeDiff = Time2Sec - Time1Sec
IF Hrs2 < Hrs1
TimeDiff = (Time2Sec+(86400)) - Time1Sec
ENDIF
finaltime = (TimeDiff/60)+ 0.1
IF finaltime < .6
finaltime=.5
ENDIF
result= round(finaltime,1)
&&store result to result
return result
EndFunc
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only