Hi All,
I've come across a really confusing problem, when I was attempting to build a workaround to the lacking Bitwise AND in access.
In excel - formulas in the header
A | B : =MOD($A2/(2^0),2)>=1 | C : =MOD($A2/(2^1),2)>=1 | D : =MOD($A2/(2^2),2)>=1 | E : =MOD($A2/(2^3),2)>=1 |
1 | TRUE | FALSE | FALSE | FALSE |
2 | FALSE | TRUE | FALSE | FALSE |
... | ||||
14 | FALSE | TRUE | TRUE | TRUE |
15 | TRUE | TRUE | TRUE | TRUE |
In Access using the same data in column A but in an access table:
SELECT ModuleBitWise,
((ModuleBitWise/(2^0)) Mod 2) >=1 as Result0,
((ModuleBitWise/(2^1)) Mod 2) >=1 as Result1
((ModuleBitWise/(2^2)) Mod 2) >=1 as Result2
((ModuleBitWise/(2^3)) Mod 2) >=1 as Result3
FROM STATIC_DATA
I get the below:
1 | -1 | 0 | 0 | 0 |
2 | 0 | -1 | 0 | 0 |
... | ||||
14 | 0 | -1 | 0 | 0 |
15 | -1 | 0 | 0 | 0 |
Does anyone know what's going on here? I'm stumped and been looking at this so long that my brain is now mush. Excel is behaving as expected however Access isn't.
Thanks,
Nick