Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7406431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:33:25+00:00 2026-05-29T05:33:25+00:00

Inside MSACCESS I want to use relatively simple bitwise operations in WHERE clause of

  • 0

Inside MSACCESS I want to use relatively simple bitwise operations in WHERE clause of queries such as this:

SELECT *
FROM Table1
WHERE Column1 (some operator) 8 = 0

This would:

  • Return rows where Column1 does not have its 4th bit set e.g. 0, 1, 2, …, 7 (all have their 4th bit clear) and 16 (it is 00010000b)
  • Exclude rows where Column1 is 8, 9, 10, …, 15 etc.

PS: are bitwise operators different from boolean operations?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T05:33:25+00:00Added an answer on May 29, 2026 at 5:33 am

    If you can run your query in in ANSI-92 Query Mode (e.g. by changing the Access UI Query Mode or by connecting to it using ADO classic or ADO.NET), use the BAND operator.

    The following code sample prints this to the Immediate window:

    8 AND 7: -1 
    8 BAND 7: 0 
    

    The first case (AND) treats both numbers as True values, so True AND True gives -1 (True). I think the BAND approach is what you’re after.

    Public Sub BitwiseAndQuery()
        'the db engine treats numbers as booleans with AND '
        Debug.Print "8 AND 7: "; _
            CurrentDb.OpenRecordset("SELECT 8 AND 7")(0)
    
        'ADO includes BAND for bitwise AND '
        Dim rs As Object
        Set rs = CreateObject("ADODB.Recordset")
        rs.Open "SELECT (8 BAND 7)", CurrentProject.Connection
        Debug.Print "8 BAND 7:"; rs(0)
        rs.Close
        Set rs = Nothing
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Inside a templated class, I found the expression, *this = NULL What does such
Inside a repeater's ItemTemplate there is a: <tr class=class1> </tr> I want this class
Inside my android map I have three overlays looking like this: what I want
Some of the queries I have written inside MS-Access are getting deleted automatically. And
Inside VS2005, our whole programming staff gets this error message sporadically and it is
Inside a function I have created, I have this loop that checks if the
Inside Magento templating code I want to get the width and height of the
Inside a fragment, I have a button which I want to trigger the filling
Inside of my outer-most layout manager, I've got this: <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=wrap_content android:orientation=horizontal
Inside my main Extension I have this standard way of instantiating a Calculator. This

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.