A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

SQL query/join syntax



 
 
Thread Tools Display Modes
  #21  
Old October 28th, 2008, 01:05 AM posted to microsoft.public.access.queries
Ken Snell \(MVP\)
external usenet poster
 
Posts: 2,506
Default SQL query/join syntax

"Spektre" wrote in message
news
Ken,

SUCCESS!!

sqlStr = "SELECT publishers.PubName, COUNT(*) FROM (((collection INNER
JOIN
issues ON collection.IssueID = issues.ID) INNER JOIN series ON
issues.SeriesID = series.ID) INNER JOIN publishers ON publishers.ID =
series.PubID) GROUP BY publishers.PubName ORDER BY COUNT(*)"

Works great...


Congratulations for persevering to the solution!



Could still use some help on the "Episodes not collected" query


Try this query (based on your updated table structure information):

SELECT Publisher.ID, Publisher.PubName,
Series.ID, Series.Bk_Name, Issues.ID
FROM ((Publisher INNER JOIN Series
ON Publisher.ID = Series.PubID) INNER JOIN
Issues ON Series.ID = Issues.SeriesID)
LEFT JOIN [Collection] ON
Issues.ID = [Collection].IssueID
WHERE [Collection].IssueID IS NULL
AND Series.ID IN
(SELECT DISTINCT I.SeriesID
FROM Issues AS I INNER JOIN
[Collection] AS C ON
I.ID = C.IssueID)


--

Ken Snell
MS ACCESS MVP




 




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 Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:19 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.