INNER JOIN problem

S

stefantem

a = "SELECT T1.field1, T1.field2 FROM Table1 AS T1 INNER JOIN Table2 AS
T2 ON T1.ID=T2.ID WHERE T2.field3=1"
Set rs = db.OpenRecordset(a)
It works

but
a = "SELECT T1.field1, T1.field2, T3.field4 FROM Table3 AS T3 INNER
JOIN (Table1 AS T1 INNER JOIN Table2 AS T2 ON S.ID_REL=R.ID_REL) ON
T1.ID=T2.ID WHERE T2.field3=1"

Set rs = db.OpenRecordset(a)
it doesn't work (Run-time error '3122': You tried to execute a query
that does not include the specified expresion 'field1' as part of an
aggregate function.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top