i am now doing an overtime claim form for my company, and i want to know how to calculate hours from the clock in and clock out field. i had done this in a table layout where the columns are for clock in (in 24-hours format), clock out(in 24-hours format) and counted hours.
CLOCK IN | CLOCK OUT | COUNTED HOURS |
---|---|---|
Views
Replies
Total Likes
How about this? You enter the time in 24-hour format, the time gets converted using a time pattern and the counted hours are calculated.
// form1.page1.subform1.table.row[0].countedHours::calculate - (FormCalc, client)
if (HasValue(clockedIn) and HasValue(clockedOut)) then
var in_ = Time2Num(clockedIn.formattedValue, "h:MM A")
var out_ = Time2Num(clockedOut.formattedValue, "h:MM A")
if (in_ >= out_) then
xfa.host.messageBox("The clocked in time cannot be greater than or equal to the clocked out time.")
$.rawValue = null
else
var diff = out_ - in_
$.rawValue = diff/3600000
endif
else
$.rawValue = null
endif
Steve
Views
Replies
Total Likes
Can you get this to work for the nightshift?
example Clock in at 9pm and clock out at 5am..
Views
Replies
Total Likes
Hi,
please check this solution, It should work for you.
Views
Replies
Total Likes
Thank you Sir!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies