Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combining multiple records
Message
 
To
28/06/2005 06:44:13
Steve Jones
Business Systems Services Uk Ltd
Swansea, United Kingdom
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Miscellaneous
Thread ID:
01026961
Message ID:
01026963
Views:
27
Steve,
could you use an variable inside a loop. in fox i would say something like
sele cusnum from customer into cursor cust1 group by cusnum
sele cust1
go top
do while not eof()
    var1 = " "
    another loop through comments file for that customer
    do while not eof()
        var1 = var1 + comment
    enddo
    
    sele newcust_table
    seek custnum
    if found
        repl newcust_table.comment with var1
    endif
    
    sele cust1
    skip,loop
enddo 
Slán
~M

>When doing an insert, how can i merge one field from multiple records in a table but not the other fields?
>
>For example, we are rewriting our application in vb.net using sql server. On the data transfer we have a customer comments table which we need to import. The format for this is
>
>CustNo Comment (varchar30)
>------- -------------------
>1 aaaaaa
>1 bbbbbb
>1 cccccc
>
>and what we need in new app is
>
>CustNo Comment (Text)
>-------- --------------------
>1 aaaaaa bbbbbb cccccc
>
>Any ideas?
>
>Thanks
>Steve
Go raibh maith agat

~M
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform