add time spent

B

bill

Each patient is entered in our database with the time they
were on the fluroscope (fluro time). If a patient was on
1hour,30 mins and 10 seconds it is entered in the data
base as 1:30:10. I want to get the total time on the scope
for all patients. What do I have to do to add hours,
minutes and seconds to get a total time for all patients?
 
D

Dave

If the data type for this field is date and time, in a
query, if you turn on Totals and select Sum as the total
value for your time field, you should get the total for
your queried records. (you will need to select one other
field to 'group' the totals by, this field must be
identical to all the values you want totalled"

If the datatype is text and you can't change it, then a VB
function could be written that would parse the text string
to find the individual number of hours, min and sec and
then add the different values (for exeample, they can all
be converted to seconds, add the 3 compononed to have a
total number of seconds (do this also for the other value
to add) then add the two second values. Then recalculate
the number of hours minutes and seconds.
 
T

tina

i don't know how many hours a patient might rack up
altogether, but if it could be more than 24 hours, then
beware. if the time is being saved in a date/time field,
then using a Totals query to get the sum of time entered
will not work when the total is more than 24 hours (even
one second more).

if you're having trouble writing a function to get the
totals, post back with the data type of the field holding
the fluoro time and i'll try to help you. or you can email
me at ttaccess1 at yahoo dot com.

hth
 

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