G
Guest
I'm trying to pull some records from a table based on two criteria as follows.
SQLText = "Select EmployeeID, Date, Status " & _
"From TimeTable " & _
"Where EmployeeID = '" & UD.EmployeeID & "' " & _
"And Date = '" & SysDate & "' " & _
"And Status = Yes;"
The Date field in the table is a date format (short date) and the variable
(sysdate) local to the vb application has been dimensioned as a date
variable. When running the statement gives me a data type mismatch error in
criteria statement. I know the error isn't getting caught up on the
employeeID part of the statement because if I change the Date field data type
in the Access table to a Text format this same SQL statement works just fine.
But I need the Date field in the table to be a date format for later SQL
comparisons and data filtering.
SQLText = "Select EmployeeID, Date, Status " & _
"From TimeTable " & _
"Where EmployeeID = '" & UD.EmployeeID & "' " & _
"And Date = '" & SysDate & "' " & _
"And Status = Yes;"
The Date field in the table is a date format (short date) and the variable
(sysdate) local to the vb application has been dimensioned as a date
variable. When running the statement gives me a data type mismatch error in
criteria statement. I know the error isn't getting caught up on the
employeeID part of the statement because if I change the Date field data type
in the Access table to a Text format this same SQL statement works just fine.
But I need the Date field in the table to be a date format for later SQL
comparisons and data filtering.