April 16, 2010 at 11:32 am
How can I remove the last semi colon from the list of names that gets created?
I want the semi colons between the names, just not at the end of the list.
SELECT LTRIM(ISNULL(RM.FIRST_NAME,'')+ ' ' + ISNULL(RM.LAST_NAME,'')+'; '
April 16, 2010 at 12:48 pm
I think we need more info. Your code here will just concatenate a first and last name. In a query, you'll get one row per record, not a list. The only reason you'll have a semi-colon is because you put it there.
Are you using this in some sort of recursive query to create a long, concatenated string from multiple records? If so, please give us a little more of the code you've already put together that better illustrates the issue.
Rob Schripsema
Propack, Inc.
April 16, 2010 at 12:52 pm
That could work but it's just a guess with the info you supplied.
LEFT(@Str, LEN(@Str) - 1)
April 16, 2010 at 1:09 pm
That did it!!
Thanks Ninja's_RGR'us
April 16, 2010 at 3:32 pm
krypto69 (4/16/2010)
How can I remove the last semi colon from the list of names that gets created?I want the semi colons between the names, just not at the end of the list.
SELECT LTRIM(ISNULL(RM.FIRST_NAME,'')+ ' ' + ISNULL(RM.LAST_NAME,'')+'; '
Post te code that creates the list of names because THAT's where this problem should be resolved.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply