Bitwise XOR

S

Sylvie

Hi everyone

I need to buid a field F1 wich is the bitwise XOR
of the Field of integer F0 in a query .

How can I do this with Access 2002 ?

Sylvie
 
J

John Vinson

Hi everyone

I need to buid a field F1 wich is the bitwise XOR
of the Field of integer F0 in a query .

How can I do this with Access 2002 ?

Sylvie

Eh? XOR takes TWO operands - what do you mean by "the bitwise XOR
of... F0"?

I think you'll need a VBA function. There was an undocumented BXOR
operator - [F1] BXOR [F2] - in some versions of Access but I think
that didn't make it into 2002.

XOR is a valid VBA operator, though, so you could write a function

Public Function BXOR(i1 As Integer, i2 As Integer) As Integer
BXOR = i1 XOR i2
End Function
 
A

Allen Browne

By "bitwise XOR", you mean flip all the bits?

Try the NOT operator:
F1 = NOT F0

In the context of an update query, use the BNOT operator under ADO:
strSQL = "UPDATE MyTable SET F1 = BNOT F0;"
CurrentProject.Connection.Execute strSQL
 

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

Similar Threads

bitwise functions 3
bitwise operator in SQL 3
Emulate XOR in Access 5
Binary NOT? 4
XOR Operation - How? 1
Calculator in C# 1
How do I do bitwise compare operations on a field? 6
logical functions with excel 3

Top