A dear friend of mine who is a master of SQL programming told me that the operators that I’m using are deaf to null values when evaluating a comparison. The way around this problem is to use the ISNULL() function around the columns that might be null. Now I am going to amend my nightly code and avoid this nasty little accident once and for all!
It’s good to have smart friends. 🙂