September 22, 2005 at 7:01 am
I found this logic somewhere on this site, and I use it all the time to build email lists. It doesn't seem to have a problem with the leading or trailing delimiter.
--lots of friends
Declare @FriendsList varchar(5000)
SELECT @FriendsList = COALESCE(@FriendsList + ', ', '') + Friends
FROM mylist
WHERE age > 25
Print @FriendsList
Mattie
September 22, 2005 at 7:31 am
Damn, the police got here too late .
September 22, 2005 at 8:00 am
MattieNH - thank you for pointing out the correction - the only excuse I have in my defense is that the later the hour the fuzzier my brain becomes..
5000 posts - not to worry - the "night police" was here represented by the Aussie World..
**ASCII stupid question, get a stupid ANSI !!!**
September 22, 2005 at 8:22 am
Sorry for the non response.. was out from 5 to 3 last night .
Not gonna let that happen again... untill next wednesday .
Viewing 4 posts - 16 through 18 (of 18 total)
You must be logged in to reply to this topic. Login to reply