SELECT DISTINCT bw.Bor_name
FROM Borrower AS bw, Loan AS l
JOIN Book_Copy AS bc
ON l.Bc_id = bc.Bc_id
WHERE bw.Bor_id = l.Bor_id
GROUP BY l.Bor_id, bc.Bt_id
HAVING COUNT( bc.Bt_id ) > 1
AND COUNT( l.Bor_id ) > 1;
This works perfectly in a MySQL testing environment but won't work in MS Access 2007 where I actually need it run. I have a few other queries which involve using JOIN and it gives the same error for them as well: "Syntax error in FROM clause".
Edit:
SELECT DISTINCT l.Bor_id
FROM Loan AS l
INNER JOIN Book_Copy AS bc
ON l.Bc_id = bc.Bc_id
GROUP BY l.Bor_id, bc.Bt_id
HAVING COUNT( bc.Bt_id ) > 1
AND COUNT( l.Bor_id ) > 1
Actually this one works fine and gives me the required id number, but what I want to output is the name which is contained in the Borrower table.