In my table, I have a column with a zero bit (inherited system ...), and another developer recently made changes to the stored procedure to show only values in which the bit column was not right (1). Since this is a nullable column, we noticed that if the column was NULL, the record was not collected. Why is this?
Both the developer and I agree that NULL <> 1 ... Is this an error in SQL or was it designed that way? Looks like a design flaw.
Current code:
(VoidedIndicator <> 1)
Suggested fix:
(VoidedIndicator <> 1 OR VoidedIndicator IS NULL)
Clarification (by John Erickson)
VoidedIndicator is a zero bit field, so it can have the following values: NULL, 0 or 1
SQL- where, (VoidedIndicator < > 1), , VoidedIndicator == 0, VoidedIndicator == 0, VoidedIndicator IS NULL. ?