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 2000 Forums
 Transact-SQL (2000)
 Formatting numeric collumn

Author  Topic 

ofsouto
Starting Member

22 Posts

Posted - 2005-08-24 : 10:25:06
Hi, dear

I need to execute a query to get a numeric (9) collumn and return a string ('000000001').
How can I get it?
Thank you very much.

Obede
Brazil

Seventhnight
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2005-08-24 : 10:34:28
this should be done on the presentation layer....

but in SQL
Select right(Replicate('0',9)+convert(varchar,<yourNumber>),9)

Corey

Co-worker on The Wizard of Oz "...those three midgets that came out and danced, the freaked me out when I was little. But they are ok now."
Go to Top of Page
   

- Advertisement -