Thread: Bitwise And
View Single Post
  #11  
Old October 3rd, 2004, 11:50 PM
Van T. Dinh
external usenet poster
 
Posts: n/a
Default

Hi Tom

Yes, I referred to "AND" in Queries / SQL. My previous post started with
"In JET, ...".

When you tested the "function" (as or similar to what Sam posted), you
tested the VBA "AND", not the JET "AND".

Test with the following SQL:

SELECT (4 And 4) As Test
FROM Table1

where Table1 is any Table with Records. You should get a whole column of -1
(True, i.e. logical operator) and not 4 (If JET And were bitwise operator).

--
Cheers
Van T. Dinh
MVP (Access)


"Tom Ellison" wrote in message
...
Dear Van:

I had to check out my facts and also test the function thoroughly
before I began responding here.

From online help:

The And operator also performs a bitwise comparison of identically
positioned bits in two numeric expressions and sets the corresponding
bit in result

This is the case for VBA, and for the use of And in a function there.
It tests out correctly there.

Perhaps you were referring to the use of And in a query. Could its
use be different there? I wouldn't think so, but haven't tested it.

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts