I'm hoping this will be obvious as to what I'm doing wrong and why my VBA query is failing. The entire query works fine in my Access application as long as I take out the reference to Null. I've tried using
(EmployeeDept_qry2.dtActEnd) Is Null without luck and my last attempt was using the function
IsNull(EmployeeDept_qry2.dtActEnd) without luck.
I'm trying to include all rows that have nulls in them for the End date field EmployeeDept_qry2.dtActend
strSQL = "SELECT DISTINCT EmployeeDept_qry2.zLName, EmployeeDept_qry2.zFName, EmployeeDept_qry2.zBadgeID FROM EmployeeDept_qry2 WHERE EmployeeDept_qry2.zDeptDesc = " & "'" & [Forms]![Main_frm]![DepartmentList] & "'" & " AND (EmployeeDept_qry2.bFullTime) = " & True & " AND IsNull(EmployeeDept_qry2.dtActEnd)" & " ORDER BY [EmployeeDept_qry2.zLName]
(EmployeeDept_qry2.dtActEnd) Is Null without luck and my last attempt was using the function
IsNull(EmployeeDept_qry2.dtActEnd) without luck.
I'm trying to include all rows that have nulls in them for the End date field EmployeeDept_qry2.dtActend
strSQL = "SELECT DISTINCT EmployeeDept_qry2.zLName, EmployeeDept_qry2.zFName, EmployeeDept_qry2.zBadgeID FROM EmployeeDept_qry2 WHERE EmployeeDept_qry2.zDeptDesc = " & "'" & [Forms]![Main_frm]![DepartmentList] & "'" & " AND (EmployeeDept_qry2.bFullTime) = " & True & " AND IsNull(EmployeeDept_qry2.dtActEnd)" & " ORDER BY [EmployeeDept_qry2.zLName]