mtwildtrout
Technical User
I have a query that needs to select information based on a field entered by the user at the time of data entry. I receive the same error message if I use the query builder or format the SQL as a string. Can a variable be used in a query/SQL statement or is there another way to accomplish this? Here is the query in SQL:
SELECT TimeCard.WorkDate, TimeCard.EmployeeID
FROM TimeCard
WHERE (((TimeCard.WorkDate)>=Date()-Weekday(Date())+2
AND (TimeCard.WorkDate)<=Date()+(8-Weekday(Date()))))
AND ((TimeCard.EmployeeID) = X);
X is the variable I'm trying to use for the EmployeeID
SELECT TimeCard.WorkDate, TimeCard.EmployeeID
FROM TimeCard
WHERE (((TimeCard.WorkDate)>=Date()-Weekday(Date())+2
AND (TimeCard.WorkDate)<=Date()+(8-Weekday(Date()))))
AND ((TimeCard.EmployeeID) = X);
X is the variable I'm trying to use for the EmployeeID