Is there a format to display hours > 23??

R

Ralph

I have a formula that calculates date diffrences in minutes. I am trying to
display the end result in hours and minutes. I.E. 99 minutes would display
as 1:39 using a date field with the format hh:nn. However, if the minutes
are greater than 1440 (total minutes in 1 day) the format "starts over".
I.E. 1451 minutes shows 0:11 and what I am hoping to get to is 24:11. In
Excel the format is [h]:nn which works fine but Access doesn't like this
format. I need to keep the data as a number or time rather than text in
order to select min, max, avg, etc. Hope this is clear!!!! Thanks!!!!
 
6

'69 Camaro

Hi, Ralph.

You don't want 24:11, unless you change the time format to begin at hour "1"
instead of hour "0." If one counts by seconds, the day starts at 00:00:00
and ends at 23:59:59. That's 24 hours worth of seconds. To bump up the
upper boundary to 24:59:59 would require a 25-hour day -- or else a 24-hour
day that starts at 01:00:00.

Daylight savings time wreaks enough havoc with people's schedules twice a
year, don't you think? 25-hour days would cause utter chaos. :-O

1,451 minutes is 1 day plus 11 minutes or 1 day + 00:11 for your display.
If you use a date/time variable, your end result needs to display the days,
as well as the hours and minutes to account for time differences that exceed
the maximum number of minutes in one day. And depending upon how much
difference exists between these two dates, you may want to consider
displaying months and years, as well.

For display purposes, you may just want to break it up into two numerical
variables instead, so that you can display hours and minutes separately,
such as 24:11 or even 3,967:11 if that large a number of hours were ever
necessary.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
 
D

Douglas J. Steele

The problem is that Access doesn't have a datatype to use for elapsed time,
just a Date datatype that's a timestamp.

The usual solution is to store the time as a long integer represent total
minutes (or total seconds, if you need that resolution) and write your own
functions to format it to h:nn[:ss] when necessary.
 
J

Jamie Collins

'69 Camaro said:
Daylight savings time wreaks enough havoc with people's schedules twice a
year, don't you think? 25-hour days would cause utter chaos.

Not to mention the 61 second minute ('leap minute') we get ever year or so.

Jamie.

--
 

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