easiest way to calculate downtime

  • Thread starter Thread starter JulieD
  • Start date Start date
J

JulieD

Hi all

i have a table containing start & stop times (by date) for a production
processing plant -
Date.......Start..........Stop.......Reason
1/1/05...8:00am.......10:00am...Smoko
1/1/05...10:15am......10:27am...Breakdown
1/1/05...10:29am.......12:00pm...Lunch
etc

what i need to do is produce a report totalling the amount of downtime by
reason e.g.
and i'm not sure what the easiest way to determine that
smoko was 15mins
breakdown was 2mins
etc

Cheers
julieD
 
DateDiff() with "n" for miNutes should do the trick, Julie.

This kind of thing:
SELECT Table1.ReasonID, Sum(DateDiff("n",[Start],[Stop])) AS Duration
FROM Table1
GROUP BY Table1.ReasonID;
 

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