|
 |
access thread: access statement that doesn't work
Message #1 by "Jimmy Lahaie" <jimmylahaie@h...> on Tue, 17 Apr 2001 04:18:54
|
|
I have 3 table
People
PersNo
PersName
...
Message
MessNo
MessTitle
Messbody
MessPNo -- The person that wrote the message
Reply
RepNo
RepMessNo
...
I want to get, in one statement, the person'name, the MessNo, MessTitle and the total of the
ryple that each message have. So i wrote
Select a.PersName, b.MessNo, b.MessTitle, count(c.RepNo) as NbrRep from People a, Message
b left join Reply c on b.MessNo = c.RepMessNo where c.PersNom = a.MessPers group by
a.MessTitle, a.MessNo, a.PersNom
and i get the error
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access Driver] Join expression not supported.
What's wrong???
Thanx
Jimmy
Message #2 by "Carol Mandra" <carol_mandra@r...> on Tue, 17 Apr 2001 18:47:15
|
|
Try this, here is a sample of joining three tables in SQL:
SELECT [a].[Fieldname] AS Expr1, Count([b].[fieldName]) AS Expr2
FROM a INNER JOIN (b LEFT JOIN c ON b.apple = c.orange) ON a.APPLE =
b.apple GROUP BY [a].[Fieldname];
It is a nested join. You need to rewrite your FROM ... statement.
Good Luck, Carol
|
|
 |