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
|
|||
|
|||
Many to Many Relationship
hi...i'm new here. i was wondering if someone could help me out. i have a many-to-many r/ship between the tblRadio and tblBlock tables. so, i created a junction table called tblRadioBlock with the primary keys of tblRadio and tblBlock as primary and foreign keys. then, i have another table called tblField, which has a one-to-many r/ship with the tblBlock, ie one block has many fields. so, i have a the tblBlock primary key as a foreign key in tblField. the problem now is, that i can't seem to link the data from field to block to table when i'm creating a report. whenever i select fields from these three tables, it won't group properly. if i select tblRadio and tblBlock fields, the report wizard will group Radio fields then Block fields. if i select Block and Field fields, it'll group by block then by fields. when i select fields from all three tables, i just get one lump of data, which is not what i want at all. i hope i've stated my problem clearly. could anyone tell me what i'm doing wrong? i'm thinking it probably has something to do with the relationships, since if the relationships are correct, the report wizard will group them correctly. ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ |
#2
|
|||
|
|||
Many to Many Relationship
guixian88 wrote in
: i have a many-to-many r/ship between the tblRadio and tblBlock tables. so, i created a junction table called tblRadioBlock with the primary keys of tblRadio and tblBlock as primary and foreign keys. then, i have another table called tblField, which has a one-to-many r/ship with the tblBlock, ie one block has many fields. so, i have a the tblBlock primary key as a foreign key in tblField. Okay: we have Blocks RadioBlocks ====== =========== Radios BlockID ------+--- BlockID ====== Description \ RadioCode --------- RCode BlockStats | Frequency etc | NumTransistors | Fields etc | ====== | FieldNumber +-- BlockID CropType etc the problem now is, that i can't seem to link the data from field to block to table when i'm creating a report. I don't understand. What is a Table -- we only have Radios, Blocks and Fields in the description above? the report wizard will group Radio fields then Block fields. if i select Block and Field fields, it'll group by block then by fields. The best answer is just Don't Use the Wizards. Start off by creating the query and get the grouping right on that first. Use the query grid design window and enter the tables you actually need, and then join them and sort them. Once you understand your data, then you can create the report -- the wizard maybe a little quicker than doing it by hand although I usually find the reverse. But do get the query right first! Hope that helps Tim F |
Thread Tools | |
Display Modes | |
|
|