![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I'm not sure if there is a difference in syntax for Access's SQL commands. I'm having trouble with what should be a very simple compound join statement. An example: 'Authors' table has a field called AuthorID. A 'Books' table has a field called BookID. Since an author can write more than one book, and a book can be written by multiple authors, this calls for a link table ("bridge table" "association table" whatever). Call that table 'AuthorsBooks.' It has only two fields, AuthorID and BookID, which match the other id fields. Robert Veiera's book on SQL (not on Access per se) spells out a query for exactly the operation above. Similar to: Select Authors.AuthorName, Books.BookTitle FROM Authors INNER JOIN AuthorsBooks ON Authors.AuthorID = AuthorsBooks.AuthorID INNER JOIN Books ON AuthorsBooks.BookID = Books.BookID Veiera's code is similar but again, written in SQL Server's dialect. I'm presuming that Access is looking for slightly different syntax. Access's error message only narrows it to the 'FROM' statement. Ideas? SELECT authors.authorname, books.booktitle |
#3
| |||
| |||
|
|
_DS <_DS (AT) __nomail (DOT) com> wrote in news:ft8nv1pob6jfeo1dk2b685voqnvjg1sclc (AT) 4ax (DOT) com: I'm not sure if there is a difference in syntax for Access's SQL commands. I'm having trouble with what should be a very simple compound join statement. SELECT authors.authorname, books.booktitle FROM ( authors INNER JOIN authorsbooks ON authors.authorid = authorbook.authorid ) INNER JOIN books ON authorbook.bookid = books.bookid; Access insists on the parentheses. |
![]() |
| Thread Tools | |
| Display Modes | |
| |