dbTalk Databases Forums  

SQL Statement Help

comp.database.ms-access comp.database.ms-access


Discuss SQL Statement Help in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
anolith
 
Posts: n/a

Default SQL Statement Help - 06-12-2004 , 09:43 PM






Hello Everyone!

I'm wondering if someone could help me out with this problem. We have
a database in Access for our library. We also have it linked to a web
search. If a book is authored by two or more authors, when the results
show up, the book is listed once for each author of that book. If it
is possible, I would like to have the book just listed once, with all
of the authors. I am pasting my code, perhaps it something in my SQL
statement that I can change to allow that to happen.

I am posting links to screen shots of the database structure, and the
results page, to make things more clearer.


SQL CODE:

SELECT Books.Title, Books.CopyrightYear, Books.ISBNNumber,
Books.PublisherName, Books.Pages, Books.CoverType, Authors.FirstName,
Authors.LastName, Topics.Topic FROM Authors INNER JOIN ((Topics INNER
JOIN Books ON Topics.TopicID = Books.TopicID) INNER JOIN BookAuthors
ON Books.BookID = BookAuthors.BookID) ON Authors.AuthorID =
BookAuthors.AuthorID where Books.Title Like '%" & l_title & "%'"

Database Relationship Structure
http://www.rit.edu/~vjl4414/relationships2.jpg

The Results Page
http://www.rit.edu/~vjl4414/resultsscreen2.jpg

SQL Code
http://www.rit.edu/~vjl4414/SQL%20CODE2.jpg


Any help wouuld be grealy appreciated!

Thank You!

Reply With Quote
  #2  
Old   
Pieter Linden
 
Posts: n/a

Default Re: SQL Statement Help - 06-13-2004 , 11:33 PM






Only way around getting the book title to appear only once is to
either use a summary query by title/ISBN or use the code at mvps.org
to concatenate the authors field in your result set.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.