How to get elapsed time?

  • Thread starter Thread starter Darrell Childress
  • Start date Start date
D

Darrell Childress

I have a table with several thousand records and one of the fields
contains the date and time that the record was written. Is there a way
that I can get the elapsed time between each record?
Thanks,
Darrell
 
Darrell,

See Access help on the DateDiff function. This should get you going...

Good Luck!
 
Thanks for the info Allen and Devlin. Both of those bits of info was
what I needed, especially that regarding a previous record.
Darrell
 
Allen, While I found your comments helpful I still have an issue I can't
seem to figure out. Say I have a table with an "ID" field, an "In Time" and
"Out Time". I want to calculate the elapsed time between events ("Out Time"
of the previous event to the "In Time" of the next event). Everything is
working fine until I forget to add a record or need to add a record with
times which fit between 2 previous records. The new record is entered at the
end of the table and the DLookUp is now finding the "Out Time" of the
previous record in the table but not the previous event (Based on the "In
TIme" and "Out Time" fields). What I want is for the DLookUp to find the "Out
Time" of the previous event based on the "In Time" and not the "ID" field for
cases like this where it may be entered later. When I change the ID field in
the expression to the "In Time" field that doesn't work... Any help would be
greatly appreciated!
 
Allen, While I found your comments helpful I still have an issue I can't
seem to figure out. Say I have a table with an "ID" field, an "In Time" and
"Out Time". I want to calculate the elapsed time between events ("Out Time"
of the previous event to the "In Time" of the next event). Everything is
working fine until I forget to add a record or need to add a record with
times which fit between 2 previous records. The new record is entered at the
end of the table and the DLookUp is now finding the "Out Time" of the
previous record in the table but not the previous event (Based on the "In
TIme" and "Out Time" fields). What I want is for the DLookUp to find the "Out
Time" of the previous event based on the "In Time" and not the "ID" field for
cases like this where it may be entered later. When I change the ID field in
the expression to the "In Time" field that doesn't work... Any help would be
greatly appreciated!
 
Back
Top