I didn't see another thread mentioning this topic, but please point me to it if it exists. I am working in Access 97.
I am trying to combine multiple queries on one form, but the results that it gives me are not even close to what I need. I have a few tables that list employee information, classes given, and a master list of the available classes. I currently have a report that lists all classes that a person has taken, sorted by their direct manager. I am trying to add an additional section to the report listing the classes in the master list that the person has not taken, based on their position. Both queries work fine one their own, but when I create a report that combines the two queries, the query that Access creates to combine them does not give the correct results. I need a way to put two queries on one report.
The results would look something like:
************************************************
Manager
Employee
Class 1 Taken Date Length
Class 2 Taken Date Length
Class 3 Taken Date Length
.
.
.
Class 1 Needed Length
Class 2 Needed Length
etc.
SQL of the two queries:
SELECT DISTINCT tblClasses.fldClassName, Auditor.[Menu Name], tblClasses.fldClassLength
FROM tblClasses, Auditor INNER JOIN (tbTrainingData INNER JOIN tbAssociateTraining ON tbTrainingData.[Class Number] = tbAssociateTraining.[Class Number]) ON Auditor.LAN_ID = tbAssociateTraining.LAN_ID
GROUP BY tblClasses.fldClassName, Auditor.[Menu Name], tblClasses.fldClassLength, Auditor.Manager, tbTrainingData.[Class Name], Auditor.Status, tblClasses.fldClassType, Auditor.Group
HAVING (((tblClasses.fldClassName)<>[tbTrainingData]![Class Name]) AND ((Auditor.Manager)=[Forms]![frmTrainingReports]![CDM Selection]) AND ((Auditor.Status)="A") AND ((tblClasses.fldClassType)=[Auditor]![Group]));
SELECT Auditor.[Menu Name], tbTrainingData.[Class Name], tbTrainingData.[Number of Hours], tbTrainingData.[Class Date], Auditor.Manager
FROM Auditor INNER JOIN (tbTrainingData INNER JOIN tbAssociateTraining ON tbTrainingData.[Class Number] = tbAssociateTraining.[Class Number]) ON Auditor.LAN_ID = tbAssociateTraining.LAN_ID
GROUP BY Auditor.[Menu Name], tbTrainingData.[Class Name], tbTrainingData.[Number of Hours], tbTrainingData.[Class Date], Auditor.Manager, Auditor.Status
HAVING (((Auditor.Manager)=[Forms]![frmTrainingReports]![CDM Selection]) AND ((Auditor.Status)="A"))
ORDER BY tbTrainingData.[Class Date];
I am trying to combine multiple queries on one form, but the results that it gives me are not even close to what I need. I have a few tables that list employee information, classes given, and a master list of the available classes. I currently have a report that lists all classes that a person has taken, sorted by their direct manager. I am trying to add an additional section to the report listing the classes in the master list that the person has not taken, based on their position. Both queries work fine one their own, but when I create a report that combines the two queries, the query that Access creates to combine them does not give the correct results. I need a way to put two queries on one report.
The results would look something like:
************************************************
Manager
Employee
Class 1 Taken Date Length
Class 2 Taken Date Length
Class 3 Taken Date Length
.
.
.
Class 1 Needed Length
Class 2 Needed Length
etc.
SQL of the two queries:
SELECT DISTINCT tblClasses.fldClassName, Auditor.[Menu Name], tblClasses.fldClassLength
FROM tblClasses, Auditor INNER JOIN (tbTrainingData INNER JOIN tbAssociateTraining ON tbTrainingData.[Class Number] = tbAssociateTraining.[Class Number]) ON Auditor.LAN_ID = tbAssociateTraining.LAN_ID
GROUP BY tblClasses.fldClassName, Auditor.[Menu Name], tblClasses.fldClassLength, Auditor.Manager, tbTrainingData.[Class Name], Auditor.Status, tblClasses.fldClassType, Auditor.Group
HAVING (((tblClasses.fldClassName)<>[tbTrainingData]![Class Name]) AND ((Auditor.Manager)=[Forms]![frmTrainingReports]![CDM Selection]) AND ((Auditor.Status)="A") AND ((tblClasses.fldClassType)=[Auditor]![Group]));
SELECT Auditor.[Menu Name], tbTrainingData.[Class Name], tbTrainingData.[Number of Hours], tbTrainingData.[Class Date], Auditor.Manager
FROM Auditor INNER JOIN (tbTrainingData INNER JOIN tbAssociateTraining ON tbTrainingData.[Class Number] = tbAssociateTraining.[Class Number]) ON Auditor.LAN_ID = tbAssociateTraining.LAN_ID
GROUP BY Auditor.[Menu Name], tbTrainingData.[Class Name], tbTrainingData.[Number of Hours], tbTrainingData.[Class Date], Auditor.Manager, Auditor.Status
HAVING (((Auditor.Manager)=[Forms]![frmTrainingReports]![CDM Selection]) AND ((Auditor.Status)="A"))
ORDER BY tbTrainingData.[Class Date];