How do I show hours and minutes in a time card i.e.: 40:32 weekly

C

Connie

I am building a database for a trucking company, and when I use the Short
Time for the time card, it will not let me input anything over 23:59 and it
does not add the weekly hours correctly. It must be on a 24 hour cycle: so,
22:30 plus 10:15 adds up to 8:45...... instead of 32:45 like it should.

Any ideas?
 
R

Rick Brandt

Connie said:
I am building a database for a trucking company, and when I use the
Short Time for the time card, it will not let me input anything over
23:59 and it does not add the weekly hours correctly. It must be on
a 24 hour cycle: so, 22:30 plus 10:15 adds up to 8:45...... instead
of 32:45 like it should.

Any ideas?

The DateTime DataType is for storing a "point in time" not an "amount of time".
To store durations you should either store a StartTime and EndTime in separate
fields or else store the number of (minutes, secods or hours) as a numeric
value.
 
K

Ken Snell [MVP]

You should store your values as long integer (or integer) values that
represent the total minutes for an entry. Then you can display the results
the way you wish (using Format, calculations, etc.) based on the minutes,
but your additions will properly add minutes and not "time".
 
B

Bob Miller

You can enter the time as text fields in the 12:45 format and build
query field that converts to minutes.
Set the Mask in the time field to 12:45 fromat. In the entry a perso
will have to only enter 4 numbers 1245 or 0345 eg.
The query should be:
SELECT Table6.timer
Val(Left([timer],InStr([timer],":")-1))*60+Val(Right([timer],InStr([timer],":")-1)
AS Timed
FROM Table6;
You can then add the column Timed and convert back to hh:mm format o
not.
Note: Never, never use Time as a field name
If you want decimal hours then use:
SELECT Table6.timer
Val(Left([timer],InStr([timer],":")-1))+Val(Right([timer],InStr([timer],":")-1))/6
AS Timed
FROM Table6;
Hope this helps,
 

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