herbivorous
Technical User
My question in micro is whether within Access there is an easy way to do a binary AND of two numbers -- to see if the two numbers share any bits that are ON (1).
The bigger picture is this -- I have a table of people with a linked table that indicates areas of interest. These areas of interests are stored in another table with an autonumber ID. Right now, there are 27 possible areas of interest, numbered 1-27. A person may have any number of areas of interest.
I would like to be able to filter for these areas of interest without having to link the two tables. Domain aggregate functions can probably do the work, but I'm afraid that this would be messy and slow. I'd like to generate a binary representation of a given person's areas of interest where bit x = 1 if a person is interested in the area whose ID number is x. I'd then generate a similar binary to represent the areas of interest for which I am searching -- 2 or 7 or 9 (...1010000100) which could be quickly compared to generate a list of people who are interested in one or more areas for which I'm searching.
If you follow me. . .
Perhaps there's a better way to do this and I'm charging down a blind alley, though it seems to me that all I want is a simple binary AND, which sure doesn't seem too much to ask.
The bigger picture is this -- I have a table of people with a linked table that indicates areas of interest. These areas of interests are stored in another table with an autonumber ID. Right now, there are 27 possible areas of interest, numbered 1-27. A person may have any number of areas of interest.
I would like to be able to filter for these areas of interest without having to link the two tables. Domain aggregate functions can probably do the work, but I'm afraid that this would be messy and slow. I'd like to generate a binary representation of a given person's areas of interest where bit x = 1 if a person is interested in the area whose ID number is x. I'd then generate a similar binary to represent the areas of interest for which I am searching -- 2 or 7 or 9 (...1010000100) which could be quickly compared to generate a list of people who are interested in one or more areas for which I'm searching.
If you follow me. . .
Perhaps there's a better way to do this and I'm charging down a blind alley, though it seems to me that all I want is a simple binary AND, which sure doesn't seem too much to ask.