[quote=419405:@Tim Seyfarth]Hello all,
I am using a simple command to delete all records who’s field ‘nrc’ is not a ‘N’.
Dim S As String = “DELETE FROM units_accounts WHERE units_accounts.nrc = ‘N’”
The problem is, when this field is null, the command does not delete the record. How to work around this?
Thanks,
Tim[/quote]
“DELETE FROM units_accounts WHERE units_accounts.nrc IS NULL”
@ Kem, yes, I wrote that wrong in my post. I’ll have a look at COALESCE - never heard of that before. @Ralph, I tried the <> ‘N’ but that still did not delete records which have a null value for that field, will also try your OR suggestion too.
The thing about SQL is that any comparison with a NULL value will evaluate to FALSE, regardless of the sense of the comparison - equals or not equals. It will be FALSE always. You have to use the special condition of IS NULL (or NOT IS NULL).
[quote]
The thing about SQL is that any comparison with a NULL value will evaluate to FALSE, regardless of the sense of the comparison - equals or not equals. It will be FALSE always.[/quote]