G
Guest
I am trying to show all employees. If I setup the query to show where they
are equal it works. What am I doing wrong?
Thanks:
--------------------------begin sql----------------------------------
SELECT DateAdd("d",-Weekday([SchedDate]),[SchedDate])+1 AS WeekOf,
tblSchedule.EmployeeID, [LastName] & "," AS LName, tblEmployee.FirstName,
Format([PhoneNumber],"(@@@) @@@-@@@@") AS Phone, tblEmployee.TermDate
FROM tblEmployee LEFT JOIN tblSchedule ON tblEmployee.EmployeeID =
tblSchedule.EmployeeID
GROUP BY DateAdd("d",-Weekday([SchedDate]),[SchedDate])+1,
tblSchedule.EmployeeID, [LastName] & ",", tblEmployee.FirstName,
Format([PhoneNumber],"(@@@) @@@-@@@@"), tblEmployee.TermDate
HAVING
(((DateAdd("d",-Weekday([SchedDate]),[SchedDate])+1)=DateAdd("d",-Weekday([forms].[frmGetCalendar].[txtDate]),[forms].[frmGetCalendar].[txtDate])+1)
AND ((tblEmployee.TermDate) Is Null));
--------------------------end sql----------------------------------
are equal it works. What am I doing wrong?
Thanks:
--------------------------begin sql----------------------------------
SELECT DateAdd("d",-Weekday([SchedDate]),[SchedDate])+1 AS WeekOf,
tblSchedule.EmployeeID, [LastName] & "," AS LName, tblEmployee.FirstName,
Format([PhoneNumber],"(@@@) @@@-@@@@") AS Phone, tblEmployee.TermDate
FROM tblEmployee LEFT JOIN tblSchedule ON tblEmployee.EmployeeID =
tblSchedule.EmployeeID
GROUP BY DateAdd("d",-Weekday([SchedDate]),[SchedDate])+1,
tblSchedule.EmployeeID, [LastName] & ",", tblEmployee.FirstName,
Format([PhoneNumber],"(@@@) @@@-@@@@"), tblEmployee.TermDate
HAVING
(((DateAdd("d",-Weekday([SchedDate]),[SchedDate])+1)=DateAdd("d",-Weekday([forms].[frmGetCalendar].[txtDate]),[forms].[frmGetCalendar].[txtDate])+1)
AND ((tblEmployee.TermDate) Is Null));
--------------------------end sql----------------------------------