total of hours

C

clanmccreery

Hello

I have a "time clock" program where my user wants to have
employees punch in and out, while showing their time
using the Short Time format (military time). It works
great except when I try to add a total field on my report

=sum(txtTime)

The sum I am getting is working on the 24 hour clock, so
someone may have a total of 26:30 but the total will only
show 02:30. How do I get the total hours to show, as in
80:00 every two weeks?

Thanks!
Clan McCreery
 
M

Marshall Barton

clanmccreery said:
I have a "time clock" program where my user wants to have
employees punch in and out, while showing their time
using the Short Time format (military time). It works
great except when I try to add a total field on my report

=sum(txtTime)

The sum I am getting is working on the 24 hour clock, so
someone may have a total of 26:30 but the total will only
show 02:30. How do I get the total hours to show, as in
80:00 every two weeks?

A DateTime field contains a date and a time. Your hours
worked is not a datetime value, but a duration. Thus, a
date/time format will be operating on a value it is
interpreting in a way you did not intend (i.e. every 24
hours is a day).

To get what you want, you have to convert the durations to
the format you want using an expression. If txtTotalWorked
is the name of your Sum text box, then another text box
would display the total in hours by using:

=Int(txtTotalWorked * 24) & Format(txtTotalWorked, "\:nn")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top