snerting
Programmer
- Oct 20, 2005
- 52
I have a bitfield in a database represented through a Long integer. I want to run sql to check if certain bits are set.
Example:
A field in the db is (64+32=96). I want to see if bit 5 is set.
Using regular VB6:
Debug.Print (96 AND 32)
32
However, using "WHERE 0 > (myBitField AND 32)" won't work as AND is reserved by SQL.
I tried using "&" but that ended up adding the integers.
How do you do this in MS Access SQL?
Example:
A field in the db is (64+32=96). I want to see if bit 5 is set.
Using regular VB6:
Debug.Print (96 AND 32)
32
However, using "WHERE 0 > (myBitField AND 32)" won't work as AND is reserved by SQL.
I tried using "&" but that ended up adding the integers.
How do you do this in MS Access SQL?