Forums

This topic is locked

Table relationships and statements

Posted 17 Dec 2002 21:17:41
1
has voted
17 Dec 2002 21:17:41 Charles Beaudry posted:
I'm working with a Access 2000 database that has five tables. Each has a relationship to another table. here is the breakdown of the relationships:

<b>Conferences Table</b>
ConferenceID

<b>Talks Table</b>
TalkConferenceID (related to ConferenceID)
TalkID

<b>News Table</b>
NewsConferenceID (related to ConferenceID)

<b>GivenBy Table</b>
GivenByTalkID (related to TalkID)
GivenBySpeakerID

<b>Speakers Table</b>
SpeakerID (related to GivenBySpeakerID)

Obviously, I'm not asking for all the SQL statements. However, I recall seeing something relating to an SQL statement using "leftjoin" to get table data to display properly.

What would be the SQL statement used (for example) for joining the Conferences Table and the Talks Table. The relationship exists between ConferenceID and TalkConferenceID.

Thanks.

Charles.



Replies

Replied 17 Dec 2002 22:08:26
17 Dec 2002 22:08:26 Dennis van Galen replied:
Joins, I can talk about those for hours, Inner join, outer join, left join, cross join, etc.

I advise you to use the visual query builder in MS-Access 2000, drop in both tables you need and select your fields.

Depending on your relationships, one to many, many to many, cascading relations you will get another join and this way you know exactly what type of join your relations need because access will do the statement for you, just point and click.

I could give you a join statement that would work in one setup, but it would return either a error or way too many results (double or quadruple even) in another setup.

Hope that helps you on your way.

with regards,

Dennis van Galen
DMXzone Manager

Extension, Tutorial and FAQ's Manager

Edited by - djvgalen on 17 Dec 2002 22:09:44
Replied 18 Dec 2002 03:04:22
18 Dec 2002 03:04:22 Charles Beaudry replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
I advise you to use the visual query builder in MS-Access 2000, drop in both tables you need and select your fields.<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

That was just too easy....Thanks. Should have thought of that before.

Reply to this topic