Calculating difference in time between one record and the next

  • Thread starter Thread starter billmahon
  • Start date Start date
B

billmahon

I have a table where I track the start and finish times of a manufactured
product. I would like to know how to subtract teh end time of the previous
batch fromthe start time of the next batch to calculate the downtime between
batches. This will be like a running sum in excel.
 
Andy, thanks for your quick response.

I probably haven't explained the issue thoroughly enough. I have a table
with hundreds of records, each of which has a start time and a finish time.
I believe your solution adequately calculates the difference between these
values.

What I want to do is calculate the difference between the end time of the
previous record and the start time of the subsequent record (to calculate
down time between the records). I don't immediately see how your solution
helps with this (perhaps I am missing something?)

Thanks!

ANDY-N via AccessMonster.com said:
billmahon said:
I have a table where I track the start and finish times of a manufactured
product. I would like to know how to subtract teh end time of the previous
batch fromthe start time of the next batch to calculate the downtime between
batches. This will be like a running sum in excel.

DateDiff("n",[StartTime],[EndTime])

N = MINUTES
H = HOURS
S = SECONDS
D = DAY
WW = WEEK
 
For starters, you need to tell us how to identify the "previous" record.
A little detail about your table structure would be helpful. Also, a few
rows of sample data followed by the results you wish to obtain from that
data never hurts.
Andy, thanks for your quick response.

I probably haven't explained the issue thoroughly enough. I have a
table with hundreds of records, each of which has a start time and a
finish time. I believe your solution adequately calculates the
difference between these values.

What I want to do is calculate the difference between the end time of
the previous record and the start time of the subsequent record (to
calculate down time between the records). I don't immediately see
how your solution helps with this (perhaps I am missing something?)

Thanks!

ANDY-N via AccessMonster.com said:
billmahon said:
I have a table where I track the start and finish times of a
manufactured product. I would like to know how to subtract teh end
time of the previous batch fromthe start time of the next batch to
calculate the downtime between batches. This will be like a
running sum in excel.

DateDiff("n",[StartTime],[EndTime])

N = MINUTES
H = HOURS
S = SECONDS
D = DAY
WW = WEEK
 

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

Back
Top