Not Null Query

This is what I'm looking for... Seems like it's still not clear. Sorry.
In my query, I don't want to see records that have ALL three fields with a value.
If ALL three have a value in those fields, I do not want that record returned.
All other combinations I want to see those records.
See my answer above
 
Try this one:
query4:
SELECT Table1.id, Table1.fld1, Table1.fld2, Table1.fld3
FROM Table1
WHERE NOT (Table1.fld1 Is Not Null AND Table1.fld2 Is Not Null AND Table1.fld3 Is Not Null)
OR (Table1.fld1 Is Null AND Table1.fld2 Is Null AND Table1.fld3 Is Null)

And remember, if the field contains a ZLS it is still "empty" but it is not null and will not be treated correctly in the expression

I'm sure there is a better way to do this but I'm done. I've spent enough time on it. I updated the sample database to include the fourth query.
 

Attachments

Try this one:
query4:
SELECT Table1.id, Table1.fld1, Table1.fld2, Table1.fld3
FROM Table1
WHERE NOT (Table1.fld1 Is Not Null AND Table1.fld2 Is Not Null AND Table1.fld3 Is Not Null)
OR (Table1.fld1 Is Null AND Table1.fld2 Is Null AND Table1.fld3 Is Null)

And remember, if the field contains a ZLS it is still "empty" but it is not null and will not be treated correctly in the expression

I'm sure there is a better way to do this but I'm done. I've spent enough time on it. I updated the sample database to include the fourth query.
Looks like Query4 did the trick. Thank You!
 

Users who are viewing this thread

Back
Top Bottom