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 » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Adding Up Hours



 
 
Thread Tools Display Modes
  #1  
Old May 27th, 2004, 04:22 PM
Jackie
external usenet poster
 
Posts: n/a
Default Adding Up Hours

I need to track the number of hours a student accumulates
while taking various courses. These hours will then need
to be added, by query, to produce a total number of hours.

My problem is that I can't use a number field because then
I'll get results like 6:53 + 1:27 = 7:80 and not 8:20.

How do I get access to recognize that anything over 60
minutes needs to be added to the hours? I've tried
changing the format of a date/time field to h:nn but that
doesn't work either.

Thanks.
  #2  
Old May 28th, 2004, 05:50 AM
ChrisJ
external usenet poster
 
Posts: n/a
Default Adding Up Hours

Just remember that formatting is window dressing, the
underlying data does not change.
One approach would be to convert all your hours and
minutes to minutes, add them up and then display them as
hours and minutes using the INT and MOD operators

The final conversion would look something like

cstr(int([TotMins]\60)) & ":" & format$([TotMins] MOD
60,"00")

-----Original Message-----
I need to track the number of hours a student accumulates
while taking various courses. These hours will then need
to be added, by query, to produce a total number of hours.

My problem is that I can't use a number field because

then
I'll get results like 6:53 + 1:27 = 7:80 and not 8:20.

How do I get access to recognize that anything over 60
minutes needs to be added to the hours? I've tried
changing the format of a date/time field to h:nn but that
doesn't work either.

Thanks.
.

  #3  
Old May 28th, 2004, 11:29 PM
Jackie
external usenet poster
 
Posts: n/a
Default Adding Up Hours

Thanks Chris - I'll give this a shot.
-----Original Message-----
Just remember that formatting is window dressing, the
underlying data does not change.
One approach would be to convert all your hours and
minutes to minutes, add them up and then display them as
hours and minutes using the INT and MOD operators

The final conversion would look something like

cstr(int([TotMins]\60)) & ":" & format$([TotMins] MOD
60,"00")

-----Original Message-----
I need to track the number of hours a student

accumulates
while taking various courses. These hours will then

need
to be added, by query, to produce a total number of

hours.

My problem is that I can't use a number field because

then
I'll get results like 6:53 + 1:27 = 7:80 and not 8:20.

How do I get access to recognize that anything over 60
minutes needs to be added to the hours? I've tried
changing the format of a date/time field to h:nn but

that
doesn't work either.

Thanks.
.

.

 




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


All times are GMT +1. The time now is 05:18 AM.


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