A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

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



 
 
Thread Tools Display Modes
  #1  
Old November 3rd, 2005, 03:02 AM
Connie
external usenet poster
 
Posts: n/a
Default How do I show hours and minutes in a time card i.e.: 40:32 weekly

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?
  #2  
Old November 3rd, 2005, 04:05 AM
Rick Brandt
external usenet poster
 
Posts: n/a
Default How do I show hours and minutes in a time card i.e.: 40:32 weekly

Connie wrote:
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.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com


  #3  
Old November 3rd, 2005, 04:08 AM
Ken Snell [MVP]
external usenet poster
 
Posts: n/a
Default How do I show hours and minutes in a time card i.e.: 40:32 weekly

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".
--

Ken Snell
MS ACCESS MVP



"Connie" wrote in message
...
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?



  #4  
Old November 3rd, 2005, 02:36 PM
Bob Miller Bob Miller is offline
Senior Member
 
First recorded activity by OfficeFrustration: May 2005
Posts: 358
Default

You can enter the time as text fields in the 12:45 format and build a query field that converts to minutes.
Set the Mask in the time field to 12:45 fromat. In the entry a person 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 or 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))/60 AS Timed
FROM Table6;
Hope this helps,
Bob
Quote:
Originally Posted by 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?
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert minutes into hours and minutes southtxxbox Worksheet Functions 6 March 29th, 2008 09:16 AM
Convert hours and minutes in time format into fractions of hours.. Akern Worksheet Functions 4 April 21st, 2005 02:56 PM
Change a date time field display from hours to minutes Geoff Database Design 1 March 1st, 2005 12:30 AM
Time - Hours and Minutes Mark Zak General Discussion 4 February 18th, 2005 01:51 AM
Displaying a figure as days, hours and minutes Arvi Laanemets Worksheet Functions 1 January 16th, 2004 02:27 PM


All times are GMT +1. The time now is 01:38 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.