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
BedrockMission!

Learn More

View all

Sign in to view all badges

Time Clock

Avatar

22-07-2008

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.

Replies

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

22-07-2008

00:00 should be midnight..according to the specs valid time is 00:00 to 23:59

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

23-07-2008

Not without writing some sort of script

Avatar

23-07-2008

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

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

24-07-2008

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.