join (1 Viewer)

cotede2

New member
Local time
Today, 05:24
Joined
Nov 30, 2010
Messages
2
Hello, I have issues while doing join.
When I need to join 2 tables, this is all right.
But when I have a third table included in the query, here come the issues!

Code:
SELECT a.book, Sum(a.ACCRUAL+a.VALUE) AS TOTAL_DISC, Sum(b.ACCRUAL+b.VALUE) AS TOTAL_REF, TOTAL_DISC-TOTAL_REF AS PL
FROM TABLE1 AS a 
INNER TABLE2 AS b ON a.ASSETID = b.ASSETID
INNER JOIN TABLE3 c ON a.TRADEID = c.TRADEID
WHERE c.TRADESTATUS = 'VER'
GROUP BY a.BOOK;

Displays Syntax Error (missing operator) in query expression 'a.ASSETID = b.ASSETID INNER JOIN CARACS c ON a.TRADEID = c.TRADEID'.


Thank you for your help
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 22:24
Joined
Jan 20, 2009
Messages
12,863
INNER JOIN TABLE3 AS c ON a.TRADEID = c.TRADEID
 

namliam

The Mailman - AWF VIP
Local time
Today, 14:24
Joined
Aug 11, 2003
Messages
11,695
INNER TABLE2 AS b ON a.ASSETID = b.ASSETID
INNER JOIN TABLE3 c ON a.TRADEID = c.TRADEID
Look again closely at your 'JOIN'
 

Users who are viewing this thread

Top Bottom