mtagliaferri
07-05-2009, 05:17 AM
Hi, I am trying to have a total for every record as a SUM of the value and all grouped by the same PSR record.
For example I have many records that have the same PSR value (2009 04 – 2009 05 – 2009 06....ect..) I would like to return only one record for 2009 04 one for 2009 05 and so on with all the totals of the relatives colums.
Here is the SQL query:
SELECT tblFlight.IDTrip, Int(Sum(tblFlight.FlightTime)*24) & ":" & Format(Sum(tblFlight.FlightTime),"nn") AS [Tot Flying Time], Count(tblFlight.IDTrip) AS [Tot Sectors], Count(tblFlight.Duty) AS [Non Operating Sectors], [Tot Sectors]-[Non Operating Sectors] AS [Operating Sectors], tblTrip.PSR
FROM tblTrip INNER JOIN tblFlight ON tblTrip.IDTrip = tblFlight.IDTrip
GROUP BY tblFlight.IDTrip, tblTrip.PSR;
Can I get some help?
Thanks
For example I have many records that have the same PSR value (2009 04 – 2009 05 – 2009 06....ect..) I would like to return only one record for 2009 04 one for 2009 05 and so on with all the totals of the relatives colums.
Here is the SQL query:
SELECT tblFlight.IDTrip, Int(Sum(tblFlight.FlightTime)*24) & ":" & Format(Sum(tblFlight.FlightTime),"nn") AS [Tot Flying Time], Count(tblFlight.IDTrip) AS [Tot Sectors], Count(tblFlight.Duty) AS [Non Operating Sectors], [Tot Sectors]-[Non Operating Sectors] AS [Operating Sectors], tblTrip.PSR
FROM tblTrip INNER JOIN tblFlight ON tblTrip.IDTrip = tblFlight.IDTrip
GROUP BY tblFlight.IDTrip, tblTrip.PSR;
Can I get some help?
Thanks