NOT function not working - can prove with screenshots

X

xyzer

When I query a query using the criteria "IS NULL" under a certain field therecord with the corresponding null value in the field appears as it should.. However, when I type NOT 7 or NOT any number actually, it does not produce the record, when it should. What are some possible reasons for this? I have shown this to some co-workers and they are stumped too. How does access correctly recognize the Null property but doesn't recognize that it's not aparticular number?
 
J

John W. Vinson

When I query a query using the criteria "IS NULL" under a certain field the record with the corresponding null value in the field appears as it should. However, when I type NOT 7 or NOT any number actually, it does not produce the record, when it should. What are some possible reasons for this? I have shown this to some co-workers and they are stumped too. How does access correctly recognize the Null property but doesn't recognize that it's not a particular number?

The NOT Boolean operator takes one argument; it returns TRUE if that argument
is False - i.e. equal to zero - and FALSE if it is TRUE (nonzero).

So the expression

NOT 7

will return FALSE, or 0.

I suspect you're using the word NOT as the common English language
conjunction, not in the way Access understands. If you are comparing a field
to see if it's unequal to 7 would be

[Fieldname] <> 7

or, logically equivalent,

NOT ([fieldname] = 7)

Perhaps you could post the SQL view of the query.
--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/Forums/en-US/accessdev/
http://social.answers.microsoft.com/Forums/en-US/addbuz/
and see also http://www.utteraccess.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top