UncleHuckleberry
Technical User
I'm having problems writing the SQL to Join a query with a table to show all employees for a particular company.
I have the following query so far:
SELECT Country, Region, Company, FullName, EmpNo, Sum(Total) As Total1, LRTime_Stamp, LRSupervisor_EmpNo, LRSupervisor_Name
FROM qSel_All_Data_2
WHERE (Country ='England') AND (Region = 'Yorkshire') AND (Company = 'MMM') AND (Type = 'Business')
GROUP BY Country, Region, Company, FullName, LRTime_Stamp, LRSupervisor_EmpNo, LRSupervisor_Name;
I then want to join this to a table called 'Employees' and show all of the records in the 'Employees' table regardless of whether they are in the 'qSel_All_Data_2' query or not.
The 'Employees' table has the following fields:
ID
Country
Region
Company
EmpNo
Fullname
And I would want to join on Country, Region, Company, Empno.
Any help would be appreciated.
"When the going gets wierd, the wierd turn pro" - R. Duke
I have the following query so far:
SELECT Country, Region, Company, FullName, EmpNo, Sum(Total) As Total1, LRTime_Stamp, LRSupervisor_EmpNo, LRSupervisor_Name
FROM qSel_All_Data_2
WHERE (Country ='England') AND (Region = 'Yorkshire') AND (Company = 'MMM') AND (Type = 'Business')
GROUP BY Country, Region, Company, FullName, LRTime_Stamp, LRSupervisor_EmpNo, LRSupervisor_Name;
I then want to join this to a table called 'Employees' and show all of the records in the 'Employees' table regardless of whether they are in the 'qSel_All_Data_2' query or not.
The 'Employees' table has the following fields:
ID
Country
Region
Company
EmpNo
Fullname
And I would want to join on Country, Region, Company, Empno.
Any help would be appreciated.
"When the going gets wierd, the wierd turn pro" - R. Duke