I have a INT field that needs to hold a four byte value which works ok as long as the first byte is not a zero. I tried using the statement below, however it is not working. If the output value should be 0760 (as in the example below) Im getting 760. Can anyone see what the problem is?
Right ('0000' + CAST(SUBSTRING(ACT, 11, 3)as varchar (3)), 3) + '0',
ACT varchar (20)
ACT value = 00000000000768000000
Output field = out_Act
out_Act int
Start Free Trial