AirNav Systems Forum
AirNav Radar => AirNav Radar Discussion => Topic started by: lennox2604 on October 18, 2009, 04:43:19 PM
-
Hi
Does anybody have a SQL script which will extract the hourly count of flights.
I have tried to get one up and running but to no avail.
The Mylog only gives for last hour
I have a cunning plan to use the information but first i need to extract it
Any help or script welcome
-
See this attachment.
-
Missed the point here
What it does NOT do is tell you the number 0000-0100; 0100-0200 thus
18/10/09 0000-0100 4
18/10/09 0100-0200 6
It is just needs extracted from the Mylog not just last 10 minutes and last hour
and i cannot get a SQL statement to do it
-
had not noticed it. It is not possible to change the time to see the records per hour.
Cumps
-
SELECT
substr(Flights.EndTime,1,13) AS Date_Hour,
COUNT(Flights.ModeS) AS Count_of_Flights
FROM
Flights
GROUP BY
Date_Hour
ORDER BY
Date_Hour
Gives something like this:
(http://farm3.static.flickr.com/2503/4025556532_804c8a1a04_o.jpg)(http://farm3.static.flickr.com/2577/4025561160_1f8c0c9445_o.jpg)
Or you could use the same SQL query on the v_Flights view to get earlier dates.
-
Tarbat, a fine script you've made there. I had the idea to handle it with a pivot table but failed as it seems that certain sql commands need to be 'rewritten' to work in sqlite. By far your script is more elegant - Salute!