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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

concatenating duplicate records

Status
Not open for further replies.

horsecarriage

Programmer
Joined
Apr 21, 2005
Messages
3
Location
US
I have a 3 column access table with the following fields

id, cat_id, category

when I do a recordset sorted by id ascending there are some duplicate cat_ids.

In other words the result would look something like this:

ID cat_id category
1 25 bowling
2 47 skiing supplies
3 47 skiing continued
4 55 archery
.
.
.
.

What I need to do is for records such as the ones that have cat_id 47 is to have them concatanated into one record.

So after the update the table would look like this:

ID cat_id category
1 25 bowling
2 47 skiing supplies skiing continued
4 55 archery
.
.
.
.

The second record gets deleted but it's contents get added to the previous record.

I need help in writing this. I'm sure there has to be a while loop and update and a delete.

Any help in writing this would be great. thanks
 
Look at Sheco's reply in this thread.

thread333-1039394

I think it will do what you are looking for.

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top