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

Combine record values 2

Status
Not open for further replies.

BrenoAguiar

IS-IT--Management
Feb 8, 2005
81
0
0
US
I have a table that looks like this:

ID Name unit
1 john 104
2 Mary 301
2 Mary 302
3 Carl 405
3 Carl 407
3 Carl 409

And I was wondering If I can combine the "unit" field values, in another table/query that would show:

ID Name unit
1 john 104
2 Mary 301, 302
3 Carl 405, 407, 409

Any thouhgts?
 
Looks like you have a design problem, one of the tenets of normalization has been broken.

You should have 1 table with Names and ID and another table with their related unit records. You would need to link these 2 tables via the ID field most likely, putting an ID field in the related table with Number data type.

Then you could easily view your data either through a query using both tables or a form with a subform using ID to link. To go about fixing your situation you could make table or copy table of the original and with the new table keep only the data that is not being repeated, so far that would be Units and keep the ID field to LINK. Then you can go about setting up linked tables on the ID field and setting up referential integrity.
 
Thanks KNicks and Leslie. DUe to the circustances both tables talk one to many in both ways, what had to do with the design estabilished. BUt I liked the Idea creating a temp table and generate an autonumber field that would work for what I need now!

Thanks a BUnch!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top