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

query/report 5 tables with 2 many to many relationships

Status
Not open for further replies.

kuanli

Technical User
Jan 28, 2002
22
CA
I'm trying to build a database of references. There are 5 tables:
Article table: articleID articleTitle sourceID
Author table: authorID firstName lastName
ArticleAuthor table: articleID authorID
Source table: sourceID sourceTitle
SourceAuthor table: sourceID authorID

There are many to many relationships between article table and author table, and between source table and author table. And there is one to many relationship between source table and article table.

Ultimately, what I want to see is this:
article, author, author, ..., source, sourceAuthor, sourceAuthor, ....
But a simple query to display all fields from all tables for each articleID always returns 0 record.

Is my goal feasible at all? If yes, how can I do it? Please help.

Thanks,
Kuan

 
Have you got entries in all the tables which will match across the query?

ie
Article table:
articleID = 1 articleTitle = Test sourceID = B827

Author table:
authorID = AAA firstName = Bill lastName = Stickers

ArticleAuthor table:
articleID = 1 authorID =AAA

Source table:
sourceID = = Alpha

SourceAuthor table:
sourceID = 1 authorID = AAA

should bring back data.

If this fails to work then try building the query by adding tables one at a time this will help to identify where the problem lies
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top