This is my calculations (very similiar to your response). What I am doing wrong? The date fields are formated to Date patterns and the "total hours worked" column is formated to numeric field.
Here is my script:
topmostSubform.detail.tot1::calculate - (FormCalc, client)
var Time1 = 0
if (HasValue(pmIn) and HasValue(pmOut)) then
Time1 = Time2Num(pmOut.formattedValue, "h:MM A") - Time2Num(pmIn.formattedValue, "h:MM A")
endif
// compute total time in hours from the millisecond value
$.rawValue = Sum(Time1)/3600000