Access 97 time format for times greater than 24hours?

F

Froog

Hi y'all,

I know you probably get this three times a day, but I can't see any posts
relating to it just now...

Is there any way of formatting a time in a calculated total on an Access 97
report which will show times greater than 24 hours?

I usually just stick to decimal times, but I can't on this occasion
(corporate productivity thing)... I've thought of extracting the hours as a
decimal and tacking on the minutes and seconds, but I'm really not too happy
about that approach.

Many, many thanks for any suggestions!
Froog
 
M

Marshall Barton

Froog said:
Is there any way of formatting a time in a calculated total on an Access 97
report which will show times greater than 24 hours?

This is an interval of time, not a time of day. So, no, you
can not format a time (since it isn't a time) using a time
format. THe key to doing what you want depends on how
you're storing the number of hours and minutes.

I usually just stick to decimal times, but I can't on this occasion
(corporate productivity thing)... I've thought of extracting the hours as a
decimal and tacking on the minutes and seconds, but I'm really not too happy
about that approach.

The most common approach is to store the total number of
minutes. In this case, you can format the value using:

=timefield \ 60 & ":" & Format(timefield Mod 60, "00")

Another way is to store the number of hours and fraction of
an hour in a Single field. Here, the expression would be:

=Fix(timefield) & ":" & Format(timefield * 60 Mod 60,
"00")

But maybe you have the "time" stored in multiple fields, or
some other data type?
 
F

Froog

Marshall Barton said:
This is an interval of time, not a time of day. So, no, you
can not format a time (since it isn't a time) using a time
format. THe key to doing what you want depends on how
you're storing the number of hours and minutes.



The most common approach is to store the total number of
minutes. In this case, you can format the value using:

=timefield \ 60 & ":" & Format(timefield Mod 60, "00")

Another way is to store the number of hours and fraction of
an hour in a Single field. Here, the expression would be:

=Fix(timefield) & ":" & Format(timefield * 60 Mod 60,
"00")

But maybe you have the "time" stored in multiple fields, or
some other data type?

Hi Marsh,

Thanks for the tips, I'll give them a try as soon as I get to work!

The data I'm storing is the output of an automatic dialler, which gives me
the length of activity in seconds as an integer, and it's kept in three
separate Double fields as per default (I tend to get a process up & running
first, then optimise - probably not the best way to go about it, but it's a
habit).

The unfortunate thing is that because of the nature of the report I need to
produce, these have to be calculated from the three fields to averages of
each (per-call stats) in a query, recalculated *back* to a total for each on
the report itself and *then* summed to give the end figure, although in
retrospect it might be easier to recalculate the totals in the query first
rather than on the report. It's convoluted I know, but it's the only way to
get my figures to match up they way they need to.

Thanks again for the response!
Froog :eek:)
 

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