Need help with a FormCalc script for time diffrence in 24 hour format on same day.
My table have repeted rows. User enter date, start time, end time and break time for each row
If he starts work midnight he enter 00:00 and if ending midnight he enter 00:00 (display set to "KK:MM" therefore 00:00 = 24:00)
All work great when entering 00:00 to 23:59
But when entering 00:00 (24:00) in end time the diffrence is -24 hours
What line do I need to add so it will work with 00:00 in the WorkTo?
form1.#subform[0].Table1.Row1.WorkTotalWorkTotal::calculate - (FormCalc, client)
var startTime = Time2Num(WorkFrom.formattedValue, "HH:MM")
var finishTime = Time2Num(WorkTo.formattedValue, "KK:MM")
if (WorkFrom==null | WorkFrom=="" | WorkTo==null | WorkTo=="")
then $=""
else
$=((finishTime) - (startTime)) / 3600000 - WorkBreak
endif