tags:

views:

52

answers:

3
+1  A: 

Can't see why not

DaveShaw
+3  A: 

(NOT A) AND (NOT B) is the same as NOT (A OR B), and this extends to more than two terms. However - sometimes NULL handling can trip you up on this. If you've no NULLs in [Panels] then all will be well, otherwise, test. :)

Will A
+3  A: 

Yep. This is just de Morgan's law. I had to think a bit about the effect of NULLS but in both versions if [Panels] IS NULL then the end result will be unknown.

In answer to your clarified question. Yes as well. I added a new "Yes/No" column to the Northwind Customers table called "TF" and both the following statements had the same effect.

UPDATE Customers SET 
TF = not ([Last Name] Like '*A*' Or 
          [Last Name] Like '*B*' Or 
          [Last Name] Like '*C*');

UPDATE Customers SET 
TF = ([Last Name] not Like '*A*' and 
      [Last Name] not Like '*B*' and 
      [Last Name] not Like '*C*');
Martin Smith
+1 the predicates are equivalent. Picky point, though: in Access, expressions with `NULL` can return an actual `NULL` value rather than being restricted to a logical UNKNOWN result. For example (and using proprietary keyword `ALIKE`, otherwise the wildcard character changes depending on ANSI Query Mode used) this `SELECT NULL ALIKE '%A%';` returns `NULL` cast as a binary value, whereas `SELECT NULL ALIKE '%';` returns zero cast as a `SMALLINT`. Things quickly get weird in Access e.g. `SELECT NULL IN (1);` returns `NULL` whereas `SELECT 1 IN (NULL);` returns zero!
onedaywhen