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 |
|
Ken Blum
Constraint Violating Yak Guru
383 Posts |
Posted - 2008-07-31 : 11:14:30
|
| Brain Cramp!declare @x bigintSET @x = 190020SELECT CONVERT(char(19),@x)This comes out as '190020 ', where the spaces are on the right.I need it to come out as ' 190020' where the spaces are to the left.Duh.... |
|
|
pootle_flump
1064 Posts |
Posted - 2008-07-31 : 11:28:17
|
Sounds like you are treating text as a number....declare @x bigintSET @x = 190020SELECT RIGHT(REPLICATE(' ', 19) + CAST(@x AS VARCHAR), 19) |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-08-01 : 07:59:37
|
quote: Originally posted by Ken Blum Brain Cramp!declare @x bigintSET @x = 190020SELECT CONVERT(char(19),@x)This comes out as '190020 ', where the spaces are on the right.I need it to come out as ' 190020' where the spaces are to the left.Duh....
Where do you want to show data?If you use front end application, do this formation thereMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|