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
 General SQL Server Forums
 New to SQL Server Programming
 Adding blanks to end of select

Author  Topic 

rjackman1959
Yak Posting Veteran

60 Posts

Posted - 2009-01-17 : 16:50:13
I need the length of this select to be 40 long with blanks at the end after I concatenate the fields. Any ideas?

select rtrim(s.lastname) + ',' + rtrim(s.frstname),

IronTiger
Starting Member

4 Posts

Posted - 2009-01-17 : 17:34:56
I believe this will work.

select CAST(rtrim(s.lastname) + ',' + rtrim(s.frstname) AS CHAR(40)),
Go to Top of Page

rjackman1959
Yak Posting Veteran

60 Posts

Posted - 2009-01-17 : 17:40:12
Perfect. Thank You
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-18 : 08:46:45
also

select CAST(replace(s.lastname + ',' + s.frstname,' ','') AS CHAR(40)),
Go to Top of Page
   

- Advertisement -