Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Time Clock

I made a time card for my company. It is very simple and calculates time and gives you a sum. It is in military time. the problem I have is when someone works till midnight. So if I enter 19:00 for a start time and 24:00 for end time, it tells me "enter time in the format 00:00" It is getting hung up on the 24:00. I have the time set for HH:MM. I tried 00:00 as well with same error.



Has anyone run into this problem?

Thanks in advance.
0 Replies

Avatar

Level 10
00:00 should be midnight..according to the specs valid time is 00:00 to 23:59
Here is what I have now that gives me the total for hours worked.



----- form1.#subform[0].Table1.Row1.RegHrTot1::calculate: - (FormCalc, client) ---------------------



var in1 = Time2Num(in1Mon1.formattedValue,"H:MM")

var out1 = Time2Num(out1Mon1.formattedValue,"H:MM")



if ((in1 > 0) and (out1 > 0)) then

$ = (((out1-in1)) / (60 * 60 * 1000))

endif



What do I need to add to round off quarter hours.



thanks.

Avatar

Level 10
Once you have the total number of minutes, then divide by 60 (that will be the hours), then the reminder will be the number of minutes left. Then either use a select statement or nested if statements that will tell you how to round the minutes off (i.e. if remainder <= 7 then 0 additional time, else if remainder <= 22 then 1/4 additional hour, else if remainder <= 37 then additional time = 1/2 hour, else if remainder <= 52 then additional time = 3/4 hour else additional time = 1 hr



I am not a programmer so someone out there may have a better way, but that is all that I could think of.