I have field in a table which has numeric(6,0)data type and has value range from 26 to 999999. I need to add leading zero's and have as finish result data type numeric(6,0). My values should be from 000026 to 999999
Example: 26 to 000026
154 to 000154
1008 to 001008
21009 to 021009
On old system it's done this way:
=zoned(substr(digits(itemnbr),1,5),6,0)
How I can do this in SQL Server?
Example: 26 to 000026
154 to 000154
1008 to 001008
21009 to 021009
On old system it's done this way:
=zoned(substr(digits(itemnbr),1,5),6,0)
How I can do this in SQL Server?