View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
stefantem[_16_] stefantem[_16_] is offline
external usenet poster
 
Posts: 1
Default INNER JOIN problem


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.)


--
stefantem
------------------------------------------------------------------------
stefantem's Profile: http://www.excelforum.com/member.php...o&userid=13594
View this thread: http://www.excelforum.com/showthread...hreadid=502409