AirNav RadarBox
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 


Author Topic: How to create a report from a few weeks ago  (Read 5784 times)

0 Members and 1 Guest are viewing this topic.

Harry

  • Jr. Member
  • **
  • Posts: 98
How to create a report from a few weeks ago
« on: July 02, 2009, 07:35:34 AM »
Hi,

I want to make some report from some weeks ago, but via the Reporter tool I only can choose between today and yesterday. Who can help me?

Harry


malc41

  • RadarBox Beta Testers
  • Hero Member
  • *
  • Posts: 586
Re: How to create a report from a few weeks ago
« Reply #1 on: July 02, 2009, 12:15:19 PM »
Harry i'm working on something

do you have/use tools like SQLite Maestro or SQLite Database Explorer
15 Miles East of EGNJ

tarbat

  • ShipTrax Beta Testers
  • Hero Member
  • *
  • Posts: 4219
    • Radarbox at Easter Ross
Re: How to create a report from a few weeks ago
« Reply #2 on: July 02, 2009, 12:36:52 PM »
If the aircraft had flight IDs, or you were running the v3.0 beta at the time, then this SQL should work (example is for 23rd June):

SELECT *
FROM
 v_Flights
WHERE
  (v_Flights.EndTime LIKE "2009/06/23%") OR
  (v_Flights.StartTime LIKE "2009/06/23%")

Download SQLite Database Browser from http://sqlitebrowser.sourceforge.net/
and copy/paste this SQL into it.
« Last Edit: July 02, 2009, 12:40:12 PM by tarbat »

Spaice

  • Full Member
  • ***
  • Posts: 192
Re: How to create a report from a few weeks ago
« Reply #3 on: July 02, 2009, 12:56:17 PM »
Tarbat, thanks for the link very useful.  Versions are available for Mac and Linux also.

malc41

  • RadarBox Beta Testers
  • Hero Member
  • *
  • Posts: 586
Re: How to create a report from a few weeks ago
« Reply #4 on: July 02, 2009, 01:26:10 PM »
tarbat

I was trying to get it to do similar but my problem was multiple instances of the same registration, which I was trying to avoid, any ideas.?
15 Miles East of EGNJ

tarbat

  • ShipTrax Beta Testers
  • Hero Member
  • *
  • Posts: 4219
    • Radarbox at Easter Ross
Re: How to create a report from a few weeks ago
« Reply #5 on: July 02, 2009, 01:30:27 PM »
SELECT DISTINCT
  v_Flights.ModeS,
  v_Flights.Registration
FROM
 v_Flights
WHERE
  (v_Flights.EndTime LIKE "2009/06/23%") OR
  (v_Flights.StartTime LIKE "2009/06/23%")

malc41

  • RadarBox Beta Testers
  • Hero Member
  • *
  • Posts: 586
Re: How to create a report from a few weeks ago
« Reply #6 on: July 02, 2009, 01:45:48 PM »
Thanks Tarbat

It was just getting my head around the distinct issue, but of course the modeS helped.

Many thanks

15 Miles East of EGNJ

tarbat

  • ShipTrax Beta Testers
  • Hero Member
  • *
  • Posts: 4219
    • Radarbox at Easter Ross
Re: How to create a report from a few weeks ago
« Reply #7 on: July 02, 2009, 01:48:57 PM »
The DISTINCT bit will ensure you don't get duplicates of the fields you've chosen to output.  So, for example, if you then added v_Flights.Callsign, you would get a lot more records, one for each callsign used by the aircraft that day.  Basically, the more fields you output, the more records you will get.  If you want very few duplicates, only output the fields you need.

malc41

  • RadarBox Beta Testers
  • Hero Member
  • *
  • Posts: 586
Re: How to create a report from a few weeks ago
« Reply #8 on: July 02, 2009, 02:21:24 PM »
What I ws trying to do was stop the duplicates but also be able to display other columns so as to see the information etc.

this is what I came up with:

SELECT registration,starttime
FROM
 flightsold
WHERE
  (flightsold.EndTime LIKE "2008/03/13%") OR
  (flightsold.StartTime LIKE "2008/03/13%") 
group by registration
15 Miles East of EGNJ

tarbat

  • ShipTrax Beta Testers
  • Hero Member
  • *
  • Posts: 4219
    • Radarbox at Easter Ross
Re: How to create a report from a few weeks ago
« Reply #9 on: July 02, 2009, 03:02:07 PM »
You could experiment with the aggregation functions.  This query just puts out one record per aircraft, and show the latest start date/time.

SELECT DISTINCT
  v_Flights.ModeS,
  v_Flights.Registration,
  MAX(v_Flights.StartTime) AS FIELD_1
FROM
 v_Flights
WHERE
  (v_Flights.EndTime LIKE "2009/06/27%")
GROUP BY
  v_Flights.ModeS,
  v_Flights.Registration
ORDER BY
  v_Flights.Registration

More help on Aggregate Functions at http://www.sqlite.org/lang_aggfunc.html
« Last Edit: July 02, 2009, 03:09:27 PM by tarbat »

malc41

  • RadarBox Beta Testers
  • Hero Member
  • *
  • Posts: 586
Re: How to create a report from a few weeks ago
« Reply #10 on: July 02, 2009, 03:12:05 PM »
Great thanks for that , hopefully this will solve some of the problems until we get the inbuilt facility? :-)
15 Miles East of EGNJ

Harry

  • Jr. Member
  • **
  • Posts: 98
Re: How to create a report from a few weeks ago
« Reply #11 on: July 02, 2009, 03:41:45 PM »
Great thanks for that , hopefully this will solve some of the problems until we get the inbuilt facility? :-)

I hope this will become a function soon, because i find it a bit strang to get the data from an external tool.
harry

malc41

  • RadarBox Beta Testers
  • Hero Member
  • *
  • Posts: 586
Re: How to create a report from a few weeks ago
« Reply #12 on: July 03, 2009, 09:35:37 AM »
Have to agree Harry
15 Miles East of EGNJ