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

Access Help: Primary key and SQL statement

Status
Not open for further replies.

mouseman

Instructor
Apr 28, 2002
44
US
Hi,

I am creating a database that includes classroom information, such as: grades, attendance, etc. I have one table that is called Student information and the primary key is the Social Security Number. The rest of the ten tables don't have a primary key because I was obtaining a duplicate error when I was entering it into the subform. In addition, all my tables have outer joins and I come up with an error when I create a query. It says: "the SQL statement could not be executed because it contains an ambiguous outer joins. To force one of the outer joins to be performed first, create a separate query that performs the first join and then include that query in your SQL statement." I am not sure how to create the SQL statement.

I can also send the database to you by email, if you want to look at it. Thank you

Stephen
 
Are you using Social Security Number to link some of the other 10 tables to the Student table?

Note that the primary key for the Student table would be a foreign key in any of the other tables. Foreign keys may have the same value in many rows. I do not think you need to specify that a column a foreign key in order to use it to JOIN the table.

Creating SQL statements can be done with the Design view or with the SQL view. In the Design view, JOINs are created by linking tables, it is a GUI (Drag and Drop) operation. Creating a query with JOINs using Design view will ensure that they are not ambiguous.

Rather that sending your database to someone, why not post the SQL statements that are causing problems?


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top