Page 1 of 1

add leading space and leading zeros

Posted: Thu Jan 27, 2011 5:56 am
by ajithaselvan
Hi,
I want all my output fields should be Right aligned.

Eg 1: If my input field: Col1, data type: Char(4), field value:+1
My output should be: +1 (2 leading spaces then field value)

Eg 2: If my input field: Col2, data type: integer(4), field value:10
My output should be:0010 (2 leading zeros then field value)


Kindly help me to resolve it.



Regards,

Posted: Thu Jan 27, 2011 6:32 am
by Ravi.K
Try the below drivations.

Col1--> Right(" ":Col1,4)
Col2--> Right("0000":Col2,4)

Posted: Thu Jan 27, 2011 11:01 pm
by ajithaselvan
Thanks Ravi