I have a query (works just great in SQL Server 200) in which I need to test on one of two conditions which due to my schema are usually mutually exclusive of each other.
Snipit:
...where (Field1 = 'aName' or Field2 is Not Null)
The problem is for the most part when Field1='aName', Field2 is almost always Null. Similarl and conversely, when Field2 is NOT null Field1 is not equal to 'aName'.
Therefore, I can not use the nvl(Field2,..) option because I end up getting records where neither condition is really met.
In a nut shell, I can't get the Or stmt to return true if the Field2 is NULL.
Please Advise
patrick
Snipit:
...where (Field1 = 'aName' or Field2 is Not Null)
The problem is for the most part when Field1='aName', Field2 is almost always Null. Similarl and conversely, when Field2 is NOT null Field1 is not equal to 'aName'.
Therefore, I can not use the nvl(Field2,..) option because I end up getting records where neither condition is really met.
In a nut shell, I can't get the Or stmt to return true if the Field2 is NULL.
Please Advise
patrick