Stephen Chaplin wrote:
I'm summing up time spent on jobs over a week, some of these jobs last
greater than 24 hours and when access sums these up it appears that it
starts again at 00:00 once it gets past 23:59.
Is it possible to display the time taken in hours and mins past the
24 hour clock? i.e 34:23?
The DateTime DataType in most all databases is intended for storing a point in
time, not a duration.
Two things lead to the confusion you are having. People use the written
expression 4:30 to mean both the time four-thirty and the duration four hours
and thirty minutes. In a database it always means the time four-thirty.
Many database engines store DateTimes under the covers as numbers so if you do
mathematical calculations on them they *appear* to work as durations. However
as you have seen, once you cross a 24 hour boundary the date portion changes and
the time portion wraps around.
The proper way to deal with durations is to store the smallest time interval
precision you care about as a number. A table tracking labor hours would
typically store this as the total number of minutes. After all summing has been
accomplished on the numeric value you can then use mathematical expressions to
convert this to hours and minutes for display purposes.
--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com