Query - Records within a certain range

joycek

New member
Local time
Today, 02:56
Joined
Aug 14, 2006
Messages
7
Hello,

I've been wrestling with this problem for a while now and any assistance would be greatly appreciated.

I have a single table containing flight data. Each record represents a single flight. What I'm attempting to do is count of pairs of flights that come within a certain range of each other. For simplicity sake, let's say that any flights A and flights B passing through Point X within a certain window of time (-15/+15 minutes) of each other are counted as a pair. Each record has a unique numeric key and all the neccessary information. Getting a table of all the possible matches is easy. The tricky part however, is that I only want to count each pair once. Is there any way this can be done with an SQL query?

I apologize in advance if this isn't specific enough. I would really appreciate any feedback whatsoever.
 
Hi!

Check DCOUNT statment where can be used for something like this:

textbox=DCount("[fieldflights]", "tblflights", [fieldcity]=' " & txtcity & " ')
by example now: if you type london on txtcity it will count only the flights where on fieldcity is recorded London.

Hope this help.....

JonyBravo
 
The feedback is much appreciated. I'm not sure DCount would work in this case however. I'm essentially counting pairs of flights that are in danger of collision. eg: Flight A and Flight B are at "almost" the same place at the same time. "Almost" is determined if Flight A is at the location of Flight B (give or take a constant) within +/- 15 minutes of each other.

I think this will be very difficult to do. But if anyone has any ideas I'd greatly appreciate it.
 

Users who are viewing this thread

Back
Top Bottom