G
Guest
The following string worked fine when the date argument in the DateAdd
function was Date(). Please could someone tell me how I should represent the
variable datDate in this string? I've tried using '#' & datDate & '#'. Any
help much appreciated.
strSQL = "SELECT tblEmployees.EmployeeID, tblEmployees.DateOff, "
strSQL = strSQL & "tblEmployees.StartDate FROM tblEmployees "
strSQL = strSQL & "WHERE (((tblEmployees.DateOff)>DateAdd('m',-6,datDate)) "
strSQL = strSQL & "AND ((tblEmployees.StartDate)<DateAdd('m',-12,datDate)))
OR "
strSQL = strSQL & "(((tblEmployees.DateOff) Is Null)) Or "
strSQL = strSQL & "(((tblEmployees.DateOff) Is Null) AND "
strSQL = strSQL & "((tblEmployees.StartDate) Is Null));"
function was Date(). Please could someone tell me how I should represent the
variable datDate in this string? I've tried using '#' & datDate & '#'. Any
help much appreciated.
strSQL = "SELECT tblEmployees.EmployeeID, tblEmployees.DateOff, "
strSQL = strSQL & "tblEmployees.StartDate FROM tblEmployees "
strSQL = strSQL & "WHERE (((tblEmployees.DateOff)>DateAdd('m',-6,datDate)) "
strSQL = strSQL & "AND ((tblEmployees.StartDate)<DateAdd('m',-12,datDate)))
OR "
strSQL = strSQL & "(((tblEmployees.DateOff) Is Null)) Or "
strSQL = strSQL & "(((tblEmployees.DateOff) Is Null) AND "
strSQL = strSQL & "((tblEmployees.StartDate) Is Null));"