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.

 All Forums
 SQL Server 2005 Forums
 Other SQL Server Topics (2005)
 Add Zeros or Spaces using derived column

Author  Topic 

soumya rao
Starting Member

2 Posts

Posted - 2009-03-28 : 03:54:35
Hi,
Request your urgent help !!
I am looking for a way to dynamically precede a numeric value with zeroes.,

For Example:-
If I have the value as 987 and the space reserved for this say 5, then I will have to display this as 00987 in the destination file.

Please revert back at the earliest.

Thanks

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-03-28 : 04:55:21
RIGHT('00000'+ CAST(Val AS varchar(5)) ,5)
Go to Top of Page
   

- Advertisement -