Hi Jeff, sorry that wasn't clear before - I was trying to keep the post short
so everyone wouldn't have to slug your way through, but I guess it's better I
explain everything.
Here are the fields in the table:
Run_Date_Time (the date/time the analysis program was run)
P_Name (Name of our satellite involved in the close approach)
S_Name (Name of satellite #2)
TCA_Date_Time (Date/Time when the two are forecasted to be closest together)
TCA_Range (Forecasted distance between the two at the TCA_Date_Time)
TCA_Date_Time, P_Name, and S_Name are what identifies a unique event... so
if a later record has the same values for those three, then we know it's an
update. Otherwise, it would be a new event.
All that matters is at the moment the two objects pass closest to each
other, what date/time will be at that moment (TCA_Date_Time), and how close
they will be (TCA_Range).
We are screening just the satellites we own, roughly about 2 dozen, which is
the P_Name. S_Name could be any of the umpteen thousands of objects floating
around in orbit. However, the data in the table will only contain pairings
where the TCA_Range is getting close to the reporting threshold. So for
example, if the threshold to send a report is if TCA_Range is within 1 km,
the table will only contain records for everything within 5km. So that way
it isn't overloaded with thousands of irrelevant records, but there would
still be records of events that were close. This will be key to determining
when and event is closed... if say yesterday's analysis had TCA_Range at
0.98km and today's analysis put it at 1.1km, we send a report telling folks
to disregard the event since it's no longer within the reporting threshold.
The main issue I'm trying to get my head around is how to get the database
to determine when a report is new or an update to a previous report, and then
determine if one from earlier is now closed. One complicating factor is that
when this report is run during the evening shift, I'd have to have it
consider Run_Date_Time values that took place prior to 1500, instead of just
having it compare today's to yesterdays... I'm not sure how to make criteria
in a query for date/time records that prior to 1500 today. But I'm thinking
I basically have to take the LastOf for Run_Date_Time and TCA_Range that have
a Run_Date_Time > 1500 today and compare then to the LastOf for Run_Date_Time
and TCA_Range with a Run_Date_Time < 1500 today.
When I tried to sketch it out on paper, I ended up making a union of five
different queries (one to get records of new events, two to determine
ongoing, two to determine closed, etc), which feels very inefficient. I was
also planning on having the queries create a new field called Report_Type
that will record whether it is an initial report, follow up, or closure. I
feel like I need a way to write a bunch of nested if-then statements in one
query instead of trying to execute a bunch of queries at once.
Hope this helps clarify what I'm trying to do... if not, please let me know.
Thanks!
Jeff Boyce said:
It all starts with the data ... and I'm still having a bit of trouble
visualizing your data structure.
From your description, it sounds like you have:
tblCloseCall
CloseCallID
AnalysisDateTime
Satellite1Name
Satellite2Name
SeparationRightNow
DateOfClosestApproach
A couple things jump out at me. First, it would seem you'd have to repeat
[DateOfClosestApproach] every time you write a new record for the two
satellites. Then, using satellite "names" might not be the best idea... if
you keep a table of satellites, you could use the SatelliteID from that
table instead of the name.
One more thing... I don't know how many satellites you are doing this for,
but it seems possible that you would have a LOT of the above records to
create/store. After all, if you are only comparing S1 with S2, and if you
have, say, 100 satellites, you'd have ... hmmm, combination or permutation
.... hmmm, do you need to know S1 vs. S2 AND S2 vs S1, or are they the
"same"?
Hmmm, might be on the order of thousands of comparisons each "analysis". I
think I'm missing something<g>!
Finally, I don't see any field that indicates how CLOSE the closest approach
will be. I thought you wanted a way to identify those approaches that are
too close, so you can notify folks.
More info, please...
Regards
Jeff Boyce
Microsoft Office/Access MVP
JCricket said:
Hello, I am looking for some advice on designing a database that deals
with a
lot of event data that is automatically stored in tables. The data is
basically about how close different satellites get to each other. The key
fields in the tables are the date/time the analysis was run, the names of
the
two satellites, the distance between them, and the date/time they will be
closest together.
My office sends out three types of notifications:
-an initial report the first time we find an event where the distance
between the satellites will be lower than a specified threshold.
-A follow-up report giving updated dated to an initial report
-A closure report if a later analysis shows the objects will no longer
meet
the reporting threshold.
So it's easy enough to query the last records against whether they meet
the
reporting distance threshold. What I am having difficult figuring out is
how
to design the queries in order to determine whether or not it's an initial
or
follow-up report. The analyses are run several times a day, so
unfortunately
I can't do something like a find duplicates between yesterday and today.
In short, it needs to be able to compare the most recent record to the
second to most recent record for a particular event in order to tell if
it's
new or if it's just updated distance data. I feel like I will end up
building queries on top of queries, but I'm not sure if that's the most
efficient way to do it.
Thanks in advance!