2 tables 1 with clients other with accno information
file, accno <- nvarchar(50)
file, accno <- nvarchar(max)
SELECT DISTINCT [File] ,STUFF( (SELECT ',' + accno FROM TableName it WHERE it.[File] = ot.[File] FOR XML PATH('')) ,1,1,'') AS [Memo] FROM TableName ot
You can adapt this but this will create a comma delimited list of your accno which I think is kind of what you are looking for? You can modify to do it with line endings in your Memo Field rather than commas.