How can I convert my DECIMAL(11)
field from 12345678
to a character value of 00012345678
?
Only use the DIGITS
function, because this verifies the length of the field numeric or decimal, etc and completes with zeros to the left when is necessary.
SELECT DIGITS(FIELD) FROM ...
The length of the resulting string is always: