Page 1 of 1

Pad with Zeros

Posted: Mon Sep 14, 2009 9:37 am
by Marcus426
HI all,

I am using a stage variable to generate a sequence of numbers like 1,2 ,3 but in the output as 00000001, 00000002 .......... Can anyone help out in how to do this

Posted: Mon Sep 14, 2009 9:41 am
by ArndW
You will need to convert the number to a string. A simple way would be to declare a VarChar(8) field and the derivatio of

Code: Select all

Right('00000000':In.StageVar,8)

Posted: Mon Sep 14, 2009 9:54 am
by Sainath.Srinivasan
Maybe the o/p is looking to suppress rather than expand the zeros.

In that case, search for "DecimalToString" and "suppress zeros"

Note - hints given to search and not direct use.

Posted: Tue Sep 15, 2009 3:13 am
by vive1005
What is the datatype you have declared for that stage variable?