I have the following Query that excludes the person with the date on a leave table with the selected date in a form.
this query is working, but I would like to change the query to look between two dates in the leave table
"Date_" and "EndDate" but It is not showing the results I was hoping to get.
this is working fine :
Code:
SELECT TE.Name, TE.EmpId
FROM tblEmpDetails AS TE
WHERE (((TE.EmpId) Not In (SELECT TL.EmpID
FROM tblEmpLeave AS TL
WHERE TL.Date_ =[Forms]![Form1]![txtDate])))
ORDER BY TE.Name;
I tried the following but it is not giving me the results I need"
Code:
SELECT TE.Name, TE.EmpId
FROM tblEmpDetails AS TE
WHERE (((TE.EmpId) Not In (SELECT TL.EmpID
FROM tblEmpLeave AS TL
WHERE TL.Date_ >=[Forms]![Form1]![txtDate] And TL.EndDate <=[Forms]![Form1]![txtDate])))
ORDER BY TE.Name;