Subject Re: [IBO] Re: clearing comboBox in grid does not produce NULL
Author Svein Erling Tysvaer
At 04:55 03.04.2003 +0000, you wrote:
>I find it a little cumbersome to have to evaluate so many
>conditions, when it seems logical to me that even though NULL is a
>state, not a value, clearly '7' and NULL are not equal...

How do you know that? If the both of us are thinking of a number and you
know that you are thinking of 7, how do you know that I'm not thinking of
the same number? NULL is UNKNOWN, something which may or may not be 7.

If you want to treat NULL as 0 without assigning 0 to your column, you have
to do checks like

if (ColumnA <> ColumnB) or
(ColumnA IS NULL AND ColumnB IS NOT NULL) or
(ColumnA IS NOT NULL AND ColumnB IS NULL) then ...

If you want to treat null as the state unknown, but treat this state as
different, you simply do

if ColumnA <> ColumnB or
ColumnA IS NULL or
ColumnB IS NULL then ...

(the difference is that this last check treats ColumnA and ColumnB as
different if both of them are unknown).

Hope this clears up some confusion,
Set