Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Vack
Aged Yak Warrior
530 Posts |
Posted - 2011-04-04 : 09:18:46
|
| Working with a field that is either a 2 char or 3 character field. I want to add leading zeros to make every value 4 characters. Table Name: iminvlocField: item_noExample: 45, 658, 67would be values in the item no field. |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2011-04-04 : 09:27:31
|
| [code]select left('0000'+cast(item_no as varchar(4)), 4) from iminvloc[/code] |
 |
|
|
|
|
|