Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combining multiple records
Message
 
À
28/06/2005 06:44:13
Steve Jones
Business Systems Services Uk Ltd
Swansea, Royaume Uni
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Divers
Thread ID:
01026961
Message ID:
01026963
Vues:
29
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform