hello again
I have a table...[tt]
ID Rating
1 56
2 17
3 44
4 11
...etc [/tt]
The MAXIMUM value of Rating is 63, so each Rating can be written as 6 bits. (ie: 56 = 111000). I want to write a query that shows the six bits for each Rating. Like this... [tt]
ID Rating b32 b16 b8 b4 b2 b1
1 56 1 1 1 0 0 0
2 17 0 1 0 0 0 1
3 44 1 0 1 1 0 0
4 11 0 0 1 0 1 1
...etc [/tt]
Now, when I type ? (56 AND 32) = 32, for example, in the immediate window, I get TRUE. And, when I type ? (56 AND 4) = 4, for example, I get FALSE as expected. My problem is that I can't get the SQL to work. when I try...
SELECT ID, Rating, ((Rating AND 32) = 32) AS b32, ((Rating AND 16) = 16) AS b16, etc....
... I get 0's in all the 'b' fields. I can't get both 1's and 0's to show as in the query output shown above.
Thanks for any clues.
Vicky C.
I have a table...[tt]
ID Rating
1 56
2 17
3 44
4 11
...etc [/tt]
The MAXIMUM value of Rating is 63, so each Rating can be written as 6 bits. (ie: 56 = 111000). I want to write a query that shows the six bits for each Rating. Like this... [tt]
ID Rating b32 b16 b8 b4 b2 b1
1 56 1 1 1 0 0 0
2 17 0 1 0 0 0 1
3 44 1 0 1 1 0 0
4 11 0 0 1 0 1 1
...etc [/tt]
Now, when I type ? (56 AND 32) = 32, for example, in the immediate window, I get TRUE. And, when I type ? (56 AND 4) = 4, for example, I get FALSE as expected. My problem is that I can't get the SQL to work. when I try...
SELECT ID, Rating, ((Rating AND 32) = 32) AS b32, ((Rating AND 16) = 16) AS b16, etc....
... I get 0's in all the 'b' fields. I can't get both 1's and 0's to show as in the query output shown above.
Thanks for any clues.
Vicky C.