If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Tying records
Hi
I am working on an existing database. I want to create a query which pulls data from 2 child records of a parent. The first record in my query would contain information frmo the first child record along with the first child record of the other table, the second to the second, etc. Is there a way to do this? Could someone help? Thanks Jeff |
#2
|
|||
|
|||
Tying records
I am not sure I understand exactly what you are trying to receive
back. Here is a method that may get you what you want depending on how your tables are related. If the child records are in the same child Table Maintable ID MainTableData ChildTable ID MainID ChildType ChildData Query would have main table and the child table TWICE in the query wizard Link the ID from the main Table to the MainID in BOTH child tables If the child table ALWAYS have both records then leave the links as normal If the child table MIGHT not have one or both of the child records, then change the links to both tables to say give you all records of main table and those only of child table that match. Data for the query would be from main table ID MainTableData ChildType from ChildTable 1 condition would be the type for one of the two records. ChildDATA from childTable1 ChildType from ChildTable2 Condtion would be the type for the other of the two records ChildData from childTable2 =========== If the child tables are two different tables everything would be the same but the second child would simply be the second child table. Ron |
#3
|
|||
|
|||
Tying records
On Thu, 20 Mar 2008 13:23:12 -0700 (PDT), Jeff wrote:
Hi I am working on an existing database. I want to create a query which pulls data from 2 child records of a parent. The first record in my query would contain information frmo the first child record along with the first child record of the other table, the second to the second, etc. Two child *tables* I presume? If you're assuming that records in a table have record numbers, or that there is a "first" and "second" record in a table, you're on the wrong track: tables are unordered "bags" of data, not ordered rows like a spreadsheet. Do you have some field or fields in the child tables which determine the order? Can you reliably count on the two child tables having the same number of records for any given parent table record? If not, what do you want to see? Perhaps an explanation of the real-world problem here would help! -- John W. Vinson [MVP] |
Thread Tools | |
Display Modes | |
|
|