How to test a bit in an integer?

  • Thread starter Thread starter Pierre Couderc
  • Start date Start date
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
 
You can use the Mod operator for this...

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

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

Back
Top