Skip to main content
1 of 8
Hadi
  • 37.6k
  • 13
  • 73
  • 128

It is not possible to test for NULL values with comparison operators, such as =, <, or <>.

You have to use the IS NULL and IS NOT NULL operators instead, or you have to use functions like ISNULL() and COLEASCE()

Select * From MyTableName where [boolfieldX] <> 1 OR [boolfieldX] IS NULL

OR

Select * From MyTableName where ISNULL([boolfieldX],0) <> 1
Hadi
  • 37.6k
  • 13
  • 73
  • 128