Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combining text data from multiple rows into single cell

Status
Not open for further replies.

schusser

Programmer
May 18, 2000
48
US
Hi all!
I'm trying to read data like...
Company State Sales
ABC MA 20000
ABC RI 3500
ABC IL 650000
XYZ VT 4500
XYZ FL 75000
XYZ CA 55000
and want the result to be...
ABC MA, RI, IL 673500
XYZ VT, FL, CA 134500
I can get the Sales OK, but how can I get the State to be right?

Thanks in advance for your help!
 
You'll need to use a function with a cursor in it to do that.

Denny
MCSA (2003) / MCDBA (SQL 2000) / MCTS (SQL 2005) / MCITP Database Administrator (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top