How to test a bit in an integer?

P

Pierre Couderc

I want to test a bit in an integer and I have SQL command :
SELECT myfiels,int FROM table WHERE (( int & 1)=1);
I want to get all the the lines where int is even.
This instruction does not work in JET motor. I suppose that my syntax is
false somewhere.

What am I missing?

Thank you in advance.
Pierre Couderc
 
P

Paul Overway

You can use the Mod operator for this...

SELECT * FROM SomeTable WHERE (SomeField Mod 2 = 0)=True
 
Top