Referencing records by Date and Time

Adamr22

New member
Local time
Today, 12:17
Joined
Oct 11, 2007
Messages
2
Hello everyone,

I am pretty new to access and I am trying to reference records by date and time. I don't know how to do it. I am keeping track of aircraft flight time for our Fire Department Helicopter. When the crew gets back from a run they enter the ending Hours or 'HOBBS' time. I've queried the HOBBS to subtract from the previous HOBBS with the following lines:

PrevHobbs: (Select Max(Hobbs) from AircraftRecord Where ([Serial Number] = Aircraft1.[Serial Number] and [Hobbs]< Aircraft1.[Hobbs]))

and

Flight Time: [Hobbs]-[PrevHobbs]

-Aircraft1 is an Alias-

We have more than one helicopter so I needed to pick out the serial number as well. I modified this line from something I found on the internet and it works most of the time. It does not work when the crew gets a call and they don't run up any hours on the helicopter. If they enter the same hobbs time as the last run it will skip the last run and subtract from two runs prior, on account of the "<" in the 'PrevHobbs' line.

I cannot reference a run by the "Run Number" (autonumber) because people will occasionally forget to enter runs and come back days later to enter them. The run numbers are then no longer consecutive. The only thing that consistantly defines a consecutive run is Date and Time.

Any help on this matter would be greatly appreciated. Thank you in advance for your time and effort.

Adam
 
1. To resolve your issue, both the Hobbs StartTime and EndTime must on the same record and be logged in by the flight crews. I think it is critical that the start and end times be logged in on the same record. Makes it a lot easier to compute the time and helps maintain the integrity of your data.
2. To resolve the issue of missing data you would need to match an EndTime with a StartTime. If there is StartTime that does not match an EndTime you would have a data gap. If that situation occurs you could have your form spit out a message to that effect.
 

Users who are viewing this thread

Back
Top Bottom