I have the following query, where I want to pull out all active employees, where their CardStatus <> "Lost Card".
SELECT
dbo_Employee.Status,
dbo_EmpBadgeNumbers.EmployeeID_FK,
dbo_EmpBadgeNumbers.CardID,
dbo_EmpBadgeNumbers.CardStatus
FROM dbo_Employee INNER JOIN dbo_EmpBadgeNumbers
ON dbo_Employee.EmployeeID = dbo_EmpBadgeNumbers.EmployeeID_FK
WHERE (((dbo_Employee.Status) = "Active")
AND ((dbo_EmpBadgeNumbers.CardStatus) <> "Lost Card"));
If I replaced <> "Lost Card" with "Lost Card", it will work,
If I replace <> "Lost Card" with null, it works (which gives the result I'm looking for)
If I replaced the <> "Lost Card" with an invalid value, it will work.
For some reason he doesn't like "<>". Yes, I know that I can just use the "null" script to get the same result. I am curious why <> does not work. If this is important, the request is pulled from the associated ODBC connection with the sql server.