<> (not equal) does not work in a simple access request

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.

+3
4

Null Null:

?Null<>"Lost Card"
Null

?Null="Lost Card"
Null

Null :

WHERE (CardStatus <> "Lost Card" Or CardStatus Is Null)
+4

CardStatus is null
OR NOT ( CardStatus = "Lost Card" )

NOT CardStatus = " "

(NOT CardStatus) = "Lost Card"

- , "=", NOT...

NOT (CardStatus = "Lost Card")
+1

< > Null.

: WHERE CardStatus < > Null
: WHERE CardStatus

+1

, CardStatus: "LostCard" null ()

, null, null . Null.

+1

All Articles