TartanSpecial
New Member
- Joined
- May 29, 2005
- Messages
- 42
Hi All
Is there an equivalent of the Bin2Dec function in Microsoft Access
Thank a lot
Nick
Is there an equivalent of the Bin2Dec function in Microsoft Access
Thank a lot
Nick
Function BinToDec(str As String) As Long
Dim i As Long, lTemp As Long, j As Long
i = Len(str)
If i > 0 Then
lTemp = 0
For j = 1 To i
If CInt(Mid(str, j, 1)) Then lTemp = lTemp + 2 ^ (i - j)
Next
End If
BinToDec = lTemp
End Function