K
KiowaPilot
I have two tables that I am using to provide info to a report named, Pilot
ATP status Report. the First Table contains basic information about
individuals and date windows that they are required to accomplish tasks.
Named Pilots
The second table contains over 5000 lines of data that contain flight
information. Flight_Input.
I am trying to use a query to identify the most recent occurance of NG in
the FS_ID field of the Flight_Input Table for the individuals in the Pilots
Table, and still display the name of the individuals who have never recieved
this code but identify those individuals with "No NG".
I have the following SQL that provides Max Date results of Pilots that have
FS_ID that equals NG but completely leaves out Pilots who have no event of NG
in the FS_ID Field. The IIF fuction in the second SQL provides the same exact
Result.
SELECT Pilots.LName, Max(Flight_Input.FLT_DATE) AS MaxOfFLT_DATE,
Flight_Input.FS_ID
FROM Flight_Input INNER JOIN Pilots ON Flight_Input.LNAME = Pilots.LName
GROUP BY Pilots.LName, Flight_Input.FS_ID
HAVING (((Flight_Input.FS_ID)="NG"));
SELECT Pilots.LName, IIf(Max(Flight_Input.FLT_DATE=Nz),"no
goggle",Max(FLT_DATE)) AS MaxOfFLT_DATE, Flight_Input.FS_ID
FROM Flight_Input INNER JOIN Pilots ON Flight_Input.LNAME = Pilots.LName
GROUP BY Pilots.LName, Flight_Input.FS_ID
HAVING (((Flight_Input.FS_ID)="NG"));
ATP status Report. the First Table contains basic information about
individuals and date windows that they are required to accomplish tasks.
Named Pilots
The second table contains over 5000 lines of data that contain flight
information. Flight_Input.
I am trying to use a query to identify the most recent occurance of NG in
the FS_ID field of the Flight_Input Table for the individuals in the Pilots
Table, and still display the name of the individuals who have never recieved
this code but identify those individuals with "No NG".
I have the following SQL that provides Max Date results of Pilots that have
FS_ID that equals NG but completely leaves out Pilots who have no event of NG
in the FS_ID Field. The IIF fuction in the second SQL provides the same exact
Result.
SELECT Pilots.LName, Max(Flight_Input.FLT_DATE) AS MaxOfFLT_DATE,
Flight_Input.FS_ID
FROM Flight_Input INNER JOIN Pilots ON Flight_Input.LNAME = Pilots.LName
GROUP BY Pilots.LName, Flight_Input.FS_ID
HAVING (((Flight_Input.FS_ID)="NG"));
SELECT Pilots.LName, IIf(Max(Flight_Input.FLT_DATE=Nz),"no
goggle",Max(FLT_DATE)) AS MaxOfFLT_DATE, Flight_Input.FS_ID
FROM Flight_Input INNER JOIN Pilots ON Flight_Input.LNAME = Pilots.LName
GROUP BY Pilots.LName, Flight_Input.FS_ID
HAVING (((Flight_Input.FS_ID)="NG"));