-
bitwise ANDs in SQL
I am trying to do a SQL query for a JET database access using a bitwise AND.
"SELECT * FROM contacts WHERE (contactType AND 2);"
so that all records where the 2nd bit of contactType is true would be returned.
The problem is that I can't find how to do the AND. It seems that in SQL Server, you could do
"SELECT * FROM contacts WHERE (contactType & 2);"
but this doesn't work as a JET query, and there doesn't seem to be an equivalent. Am I going to have to break the current long Integer field into lots of independent Booleans, or is there a way to do it.
Anyone??
Aidan
-
surely someone must know whether this is possible