Gap report (1 Viewer)

Steve@trop

Registered User.
Local time
Yesterday, 19:48
Joined
May 10, 2013
Messages
148
The database I'm working on is used to record machine readings several times a day. Management wants a report to show when there are large gaps in the time between readings (to show if/when they were missed). I'm calling this a "Gap Report". Each record is a set of readings and includes the system time from when the readings were recorded. I'm thinking the query would need to look at all the readings in the order they were recorded and then calculate the time difference between each of them. From there I would need to look at each of these calcuations to see if any are above a certain threshold. Can I do this with a query or will it require a function?
 

plog

Banishment Pending
Local time
Yesterday, 21:48
Joined
May 11, 2011
Messages
11,653

Steve@trop

Registered User.
Local time
Yesterday, 19:48
Joined
May 10, 2013
Messages
148
Thanks Plog,

That's close. I need it to calculate ALL the gaps, not just the latest one. Sometimes a reading is missed, then subsequent readings are done without much of a gap between them. I want to be able to pick out any large gaps between readings over a period of time.

Each shift is supposed to do 2 readings, there are 3 shifts per day. Let's say they run the report on Friday. They want to be able to see that on Tuesday, there was a 6-hour gap between readings. This is a routine thing, sometimes they miss readings because they are busy with unexpected things. Management just wants to be able to track this and account for it.
 

JHB

Have been here a while
Local time
Today, 04:48
Joined
Jun 17, 2012
Messages
7,732
Last edited:

plog

Banishment Pending
Local time
Yesterday, 21:48
Joined
May 11, 2011
Messages
11,653
I need it to calculate ALL the gaps,

Because its in a query, that's exactly how my method would work. For every record it will find the prior reading and determine the gap between the current record and the prior one.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 03:48
Joined
Sep 12, 2006
Messages
15,660
i would probably get the readings in a query sorted in the way you want, and have a vba sub to process the query and calculate the gaps.

maybe make use a "temporary" field in the readings record.
 

Users who are viewing this thread

Top Bottom