I have four DB tables.
Employee table has ID, Name
EmployeeGroup has EmployeeID, GroupID (Employees are in a group)
TixEventSignups table has EmployeeID, EventID, NumOfTix(Employees get tix to an event)
Event table has EventID, Name
I need the Employee Name and NumOfTix requested for their group for an event, but I need all the Names in the group even if they have no rows in TixEventSignups.
Seems easy, what am I doing wrong?
Thanks
Employee table has ID, Name
EmployeeGroup has EmployeeID, GroupID (Employees are in a group)
TixEventSignups table has EmployeeID, EventID, NumOfTix(Employees get tix to an event)
Event table has EventID, Name
I need the Employee Name and NumOfTix requested for their group for an event, but I need all the Names in the group even if they have no rows in TixEventSignups.
Seems easy, what am I doing wrong?
Thanks
Code:
Select e.LastName, tes.Requested
FROM Employee e
INNER JOIN TixGroups_Emp tge ON e.EmployeeID = tge.Employee
LEFT JOIN TixEvent_Signups tes ON tes.EmpID = e.EmployeeID
where tge.[Group]=2
AND tes.EventID = 408