Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2009
    Posts
    3

    Exclamation Unanswered: Select query giving trouble

    Hello all,

    I have a table (generated from a maketable query) with the following fields :

    Airline Code
    Airline Name
    Standard Time of Arrival (STA)
    Hour of Arrival (retrieved with Hour function)
    Origin
    Standard Time of Departure (STD)
    Hour of Departure
    Destination
    Deplaned Passengers
    Enplaned Passengers

    What I need to obtain is the number of deplaned and enplaned passengers per hour:

    Hours (unique values of Hour of departure combined with hour of arrival)
    Deplaned Passeengers
    Enplaned Passengers


    I have spent time on it and googled it for hours but I haven't found a solution for my problem.

    I have tried a query like :
    SELECT tblFlightDate.Hour_STA, Sum(tblFlightDate.Average_DePax) AS Deplanements, Sum(tblFlightDate.Average_EnPax) AS Enplanements
    FROM tblFlightDate
    GROUP BY tblFlightDate.Hour_STA;

    This query has the format that i want but doesn't give me all hours and all enplaned passengers since i only select hours of arrival.

    It doesn't look that I hard but I haven't been able to figure out how to make it work.

    Hope you'll help me,

    Thank you.

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Doubt this is right, but it will at least provoke some clarification of requirements:
    Code:
    SELECT tblFlightDate.Hour_STA, Hour_STD, Sum(tblFlightDate.Average_DePax) AS Deplanements, Sum(tblFlightDate.Average_EnPax) AS Enplanements
    FROM tblFlightDate
    GROUP BY tblFlightDate.Hour_STA, Hour_STD
    STD FTW!
    Testimonial:
    pootle flump
    ur codings are working excelent.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •