View Full Version : Find null input


ILMV
04-18-2009, 04:30 PM
Hello All

I know you can use SQL to check for a null value on a single field, but how do I check to see if any specified fields are null.

Many Thanks :)

wiklendt
04-18-2009, 05:18 PM
run a query and, depeding on your data type, have the criteria as either Is Null or <>""

LPurvis
04-20-2009, 08:11 AM
Just to offer a couple of thoughts on this...
You say you know how to check on a single field. Then you've already used Is Null as suggested by wiklendt.
If you wanted fields that weren't Null or zero length string then her second suggestion would be applicable - though I would suggest just > ""

Your issue of checking more than one field is just a simple extention of what you already know. You need to apply the crieria for Null in each of the columns you want to check. You ask for "any" of the fields - so these conditions need to be OR.

In SQL it's
SELECT * FROM TableName WHERE Field1 Is Null OR Field2 Is Null OR FieldZ Is Null

In the QBE grid - you apply OR conditions by just using subsequent, different rows rather than placing the criteria for each column in the same row.