ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   What's wrong with this SQL join statement???? (https://www.excelbanter.com/excel-programming/347866-whats-wrong-sql-join-statement.html)

Hexman

What's wrong with this SQL join statement????
 

I've tried many ways to get a simple Select-with-Join statement to
work without success. I've stripped this down to barely nothing and
it still doesn't work If I can't get this simple statement to work,
how will I ever add the necessary "where" clause with parameters and
the "Order By" clause???

Here's the simple statement:

sqlquery = "select endate, endiv, endept, enaccount, wonumber,
woaccount from (entries join wotrans) on (entries .enaccount =
wotrans.woaccount) "

That's all on one line. The error is "Syntax error in JOIN
operation."

You can do a select, join, where and order by statement in VBA Excel
2003 against an Access Database, can't you?

Hexman



MrScience

What's wrong with this SQL join statement????
 

Hexman wrote:
I've tried many ways to get a simple Select-with-Join statement to
work without success. I've stripped this down to barely nothing and
it still doesn't work If I can't get this simple statement to work,
how will I ever add the necessary "where" clause with parameters and
the "Order By" clause???

Here's the simple statement:

sqlquery = "select endate, endiv, endept, enaccount, wonumber,
woaccount from (entries join wotrans) on (entries .enaccount =
wotrans.woaccount) "

That's all on one line. The error is "Syntax error in JOIN
operation."

You can do a select, join, where and order by statement in VBA Excel
2003 against an Access Database, can't you?

Hexman


Do you have a reference set in your project to DAO 3.51 Object Library?
This is under the tools menu, references in the VBE.


Hexman

What's wrong with this SQL join statement????
 
On Sun, 11 Dec 2005 20:05:13 -0800, Hexman wrote:


I've tried many ways to get a simple Select-with-Join statement to
work without success. I've stripped this down to barely nothing and
it still doesn't work If I can't get this simple statement to work,
how will I ever add the necessary "where" clause with parameters and
the "Order By" clause???

Here's the simple statement:

sqlquery = "select endate, endiv, endept, enaccount, wonumber,
woaccount from (entries join wotrans) on (entries .enaccount =
wotrans.woaccount) "

That's all on one line. The error is "Syntax error in JOIN
operation."

You can do a select, join, where and order by statement in VBA Excel
2003 against an Access Database, can't you?

Hexman


I found it. I had to fully qualify each field name. As example:

entries.endate, wotrans.woaccount, etc.


Sorry if anyone took time on this wild goose chase. (I won't give up
quite as easily next time.)

Hexman


All times are GMT +1. The time now is 07:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com