Add hours and min that exceed 24

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a data base that tracks the total time employees spend on each phase
of their projects. Each phase has a field with a time in hours or minutes in
it. I need to be able to add these times together and have it displayed in
hours and minutes, not days. For example, for a total of 25 hours 10 min I
need it to read as such, not as 1 day, 1 hour, 10 min.

Thanks,
Rob
 
Rob said:
I have a data base that tracks the total time employees spend on each
phase of their projects. Each phase has a field with a time in hours
or minutes in it. I need to be able to add these times together and
have it displayed in hours and minutes, not days. For example, for a
total of 25 hours 10 min I need it to read as such, not as 1 day, 1
hour, 10 min.

Thanks,
Rob

The DateTime DataType in Access/Jet is intended for storing a point in time, not
an amount of time. While in some circumstances it can be used for that purpose
one must always keep in mind that you are trying to coerce behavior from the
system that it was not really designed for.

For durations, you are better off storing an integer value representing the
number of the smallest increment you need to track (in your case minutes) and
then use an expression for display purposes that converts it into hours and
minutes. For example...

[DurationField]\60 & ":" & Format([DurationField] Mod 60, "00")

....will give you hours and minutes when [DurationField] contains the number of
minutes.
 
Rob

It isn't clear from your description what data type you have assigned to the
field you are using for time. If you've used the Date/Time data type, be
advised that the Access Date/Time data type stores "point-in-time" data, not
"duration".

As far as I know, in Access, you need to store duration as a number of
(hours, or minutes, or seconds, or ... -- whatever the lowest unit of
measure is you are using). Then you need to build parsing routines that
display the number as number of hours, number of minutes, etc.
 

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

Back
Top