if output > 1?

  • 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

  • Damn, the police got here too late .

  • 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 !!!**

  • 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