473,431 Members | 1,623 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,431 software developers and data experts.

grouping multiple records on joined table

I have 2 tables
TABLE A
| id | name |
| 1 | John |
| 2 | David |
| 3 | Adam |

TABLE B
| id | colors |
| 1 | blue |
| 1 | red |
| 1 | yellow |
| 2 | blue |
| 3 | green |
| 3 | black |

When I join the tables by ID I get
| 1 | John | blue |
| 1 | John | red |
| 1 | John | yellow |
| 2 | David | blue |
| 3 | Adam | green |
| 3 | Adam | black |

I would like to merge all the records from table B into one field for
each record from table A:
| 1 | John | blue, red, yellow |
| 2 | John | blue |
| 3 | Adam | green, black |

Thanks for all help,
Jack

Sep 5 '07 #1
1 1434
Hi Jack,

This page has two modules that I think will work for you:

http://www.mvps.org/access/modules/index.html

Try:

Concatenate fields in same table

or

Return a concatenated list of sub-record values

Good luck,
Shira

On Sep 4, 9:19 pm, JackpipE <pipe.j...@gmail.comwrote:
I have 2 tables
TABLE A
| id | name |
| 1 | John |
| 2 | David |
| 3 | Adam |

TABLE B
| id | colors |
| 1 | blue |
| 1 | red |
| 1 | yellow |
| 2 | blue |
| 3 | green |
| 3 | black |

When I join the tables by ID I get
| 1 | John | blue |
| 1 | John | red |
| 1 | John | yellow |
| 2 | David | blue |
| 3 | Adam | green |
| 3 | Adam | black |

I would like to merge all the records from table B into one field for
each record from table A:
| 1 | John | blue, red, yellow |
| 2 | John | blue |
| 3 | Adam | green, black |

Thanks for all help,
Jack

Sep 5 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: cjm | last post by:
I need to group records and assign a setid to the group. I have a table with data that looks like this ColA ColB 94015 01065 94016 01065 94015 01085 94015 01086 33383 00912 32601 00912
1
by: anmar | last post by:
I'm trying to figure out how to select all the records in one table which have multiple specified records in a second table. Here's a simplified version of my problem. I have two tables,...
9
by: Ed_No_Spam_Please_Weber | last post by:
Hello All & Thanks in advance for your help! Background: 1) tblT_Documents is the primary parent transaction table that has 10 fields and about 250,000 rows 2) There are 9 child tables with...
6
by: Christopher Harrison | last post by:
Is there a way to store an indefinite number of keys in one field and self join them? Imagine, for example, you have a table of users with a "friends" column. Say user 1 is friends with users 9, 7,...
0
by: Stephen | last post by:
I have the following xslt and I am trying to use two levels of grouping. I am first grouping on the report category, then on the report type. The problem is I am sure I have to apply some sort of...
3
by: Steve | last post by:
I have a people table of about 25 fields. The table is initially created each year from 5 different sources. The records from each source are appended to the people table. Any person may be in one...
3
by: ahaque38 | last post by:
Hello. Using A2K SP3, I am having the following problem with a report using "Sorting and Grouping". I have recently added a grouping in the reports for "Category2<>'CONTRACTS'". I have...
5
by: BillCo | last post by:
I'm having a problem with a union query, two simple queries joined with a union statement. It's created in code based on parameters. Users were noticing some inconsistant data and when I analysed...
52
by: MP | last post by:
Hi trying to begin to learn database using vb6, ado/adox, mdb format, sql (not using access...just mdb format via ado) i need to group the values of multiple fields - get their possible...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.