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.
| Author |
Topic |
|
dr223
Constraint Violating Yak Guru
444 Posts |
Posted - 2010-02-18 : 10:27:39
|
Hallo, When I have the select query below; Select dbo.tblProjectPractices.PracticeGPID AS GPIDfrom dbo.tblProjectPractices It provides me with values; 824 115678I want to format this so that it should be 000824000011005678how can I do this?Thanks |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-02-18 : 10:35:30
|
| [code]Select RIGHT ('000000'+ CAST(dbo.tblProjectPractices.PracticeGPID AS varchar(10)),6) AS GPIDfrom dbo.tblProjectPractices[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
dr223
Constraint Violating Yak Guru
444 Posts |
Posted - 2010-02-18 : 11:04:00
|
| Thanks |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-02-18 : 11:06:19
|
welcome ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|