COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: sanchoniathon on 21 May 2009 01:30:22 PM

Title: How to add "zeros" to a String type column ?
Post by: sanchoniathon on 21 May 2009 01:30:22 PM
Hi,

We use Report Studio 8.3
We need to format a String type column in our list.

The column has 5 to 7 characters.

We want to format the column in order to ADD "zeros" when less than 7 characters.

For example:
12345
would become
0012345

Is this possible and how ?

Thanks !
Title: Re: How to add "zeros" to a String type column ?
Post by: david.stachon on 21 May 2009 09:56:48 PM
just a semantic difference, that's not "adding" it's called concatenating.

...and in this circumstance it's called "padding":

if you're using Oracle, the function you're looking for is called: "LPAD".