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!

Concatinate fields

Status
Not open for further replies.

chrisgreen

Programmer
Jun 28, 2000
61
GB
I have a table with :

ActivityNo, lineNo and comments

ActivityNo and LineNo is the key.

The comment is spead in the table accross the lineNo with the same activityNo. I want to produce a query that has the fields ActivityNo and comments. To do this I need to concatinate all the comments, how do I do this?
 
This cannot be done in a single query. Break it into two parts.

In modules, create a function whose parameter is ActivityNo. In the function, write code to fetch comments and concatenate them. The return value of this function will be this long string.

In Queries section, write a select stmt picking up the DISTINCT ActivityNo's and calling the function.

You will get the required result.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top