Forum Discussion

SGeorgie's avatar
SGeorgie
Brass Contributor
Sep 20, 2023

SQL - The field contains NULL, 0 or 1 - i want to see anything but 1 - how to write

Hi

 

I only want the column to bring back 0 or NULL - ive tried 

 

  • <>1      but that only brings back 0  

 

  • IN (N' ', N'0') but doesnt like it,
  • LIKE...
  • NOT = N'1'

 

nothing works, they all bring back (if work at all) 0 and not NULL and there are definitely NULL in the data

 

Thanks 

Sarah

 

 

  • SGeorgie 

    If you return back to Excel grid it doesn't support blank as a value, null is auto-lifted to zero. You may return empty string ("") instaed.

Resources