Calculating difference in time between one record and the next

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.
 
A

ANDY-N via AccessMonster.com

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
 
B

billmahon

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
 
B

Bob Barrows [MVP]

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
 
C

Christine Wilson

I am having the same problem. I am looking at distances travelled over time.
Each record is a location at a particular time. I have an object id field
which is unique to each record. In excel it is simple to do this, but our
database has thousands of records. I would like to know an easy way to do
this in access. Also, why does it seem as though excel is so much easier to
use in this respect? I feel as though I am not using access to it's full
ability.
Thanks

Bob Barrows said:
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 wrote:
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

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
 
B

Bob Barrows [MVP]

Please show us a few records of sample data in tabular format, followed
by the results you would wish to obtain from that sample data, again in
tabular format.

Christine said:
I am having the same problem. I am looking at distances travelled
over time. Each record is a location at a particular time. I have an
object id field which is unique to each record. In excel it is
simple to do this, but our database has thousands of records. I
would like to know an easy way to do this in access. Also, why does
it seem as though excel is so much easier to use in this respect? I
feel as though I am not using access to it's full ability.
Thanks

Bob Barrows said:
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!

:

billmahon wrote:
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

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get
a quicker response by posting to the newsgroup.
 

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