Hi All,
Can anyone please help me..
Source is having Varchar(10) and target is Char(10).My Requirement is...
any length of data till length 10 can come from source,and i need to pad this data with leading zeroes followed by that data so that length in target side is remain 10.
Ex.
if data is coming like 12345 then populate 0000012345,
if data is coming like 432 then populate it as 0000000432.
if data is coming like 1234567 then populate it as 0001234567.
Please help me.
How to PAD with Leading Zeroes
Moderators: chulett, rschirm, roy
How to PAD with Leading Zeroes
ambasta
I can think of a couple of approaches in a transform stage using string functions.
One would be
or to name just two methods.
One would be
Code: Select all
STR('0',10-Len(In.String)):In.String
Code: Select all
RIGHT('0000000000':In.String,10)
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Re: How to PAD with Leading Zeroes
Hi,
Try this FMT("input column", "10'0'R").
Try this FMT("input column", "10'0'R").
Source is having Varchar(10) and target is Char(10).My Requirement is...
any length of data till length 10 can come from source,and i need to pad this data with leading zeroes followed by that data so that length in target side is remain 10.
Ex.
if data is coming like 12345 then populate 0000012345,
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: