number 0 translates to chr(0) 0x00 (not 0x80) number 1 translates to chr(1) 0x01 (not 0x81) ... number 208142404 to chr(12)+chr(104)+chr(0)+chr(68) 0x0C680044 (not chr(140)+chr(104)+chr(0)+chr(68) 0x8C680044)It's a very simple UDF to get that, but bintoc() would have been even simpler.