Average calls per hour (Divide Time hh:mm:ss by a number)

S

Stas Hagemans

Hi,

Access 2003 Database.
I have a report that comes in bulk and needs to be send to seperate persons.
The report comes with total time logged on in hh:mm:ss and the total calls
made during that time.

I am stumped. The only solution i can think of is putting this in diffrent
collums but i'm hoping there is a cleaner easier solution.

Anyone got an idea?
 
D

Douglas J. Steele

Date/Times in Access are stored as an 8 byte floating point number, where
the integer portion represents the number of days relative to 30 Dec, 1899,
and the decimal portion represents the time as a fraction of a day. There is
no Time data type in Access, and certainly nothing that's intended to hold
time durations. If you're got a Time value in hh:nn:ss that's under 24
hours, it's actually stored as a time on 30 Dec, 1899. If it's more than 24
hours, it'll be stored as a time on a subsequent date.

Since there are 86400 seconds in a day, multiplying the time duration by
86400 will give you the total number of seconds represented by that
duration. Divide that value by your number of calls, and you'll have the
average duration of each call in seconds. It's fairly straight-forward to
write a function that can convert seconds to hh:nn:ss format.
 
S

Stas Hagemans

Okay that sounds pretty straight forward. But what datatype do i need that
field to be? If i have it on date/time then i get an error msg when i try to
enter anything above 24:00:00. if its on dt Number i get an error on the ":"
 
R

Rick Brandt

Stas said:
Okay that sounds pretty straight forward. But what datatype do i need
that field to be? If i have it on date/time then i get an error msg
when i try to enter anything above 24:00:00. if its on dt Number i
get an error on the ":"

LongInteger and you DON'T enter values like 24:00:00 you enter regular numbers
that represent the total number of seconds. You can convert *for display* on
forms and reports to the 00:00:00 format.
 
Top