BITAND( ) Function

Example   See Also

Returns the result of a bitwise AND operation performed on two numeric values.

Syntax

BITAND(nExpression1, nExpression2)

Returns

Numeric

Arguments

nExpression1, nExpression2

Specifies the numeric values on which the bitwise AND operation is performed. If nExpression1 and nExpression2 are not integers, they are converted to integers before the bitwise AND operation is performed.

Remarks

BITAND( ) compares each bit in nExpression1 to the corresponding bit in nExpression2. If the bits in nExpression1 and nExpression2 are both 1, the corresponding result bit is set to 1; otherwise, the corresponding result bit is set to 0.

The following table shows the result of a bitwise AND operation on corresponding nExpression1 and nExpression2 bits:

nExpression1 bit nExpression2 bit Resulting bit
0 0 0
0 1 0
1 1 1
1 0 0