Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default 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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default 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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default 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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
What's wrong with this if statement? Karen Excel Discussion (Misc queries) 5 July 19th 08 04:54 PM
Join tables like inner join in Access ryanp Excel Discussion (Misc queries) 2 July 18th 08 03:35 PM
IF Statement help please - again - got it wrong last time! Alan Davies Excel Worksheet Functions 2 May 12th 06 12:28 PM
wts wrong with this statement Jason Excel Worksheet Functions 2 February 24th 06 02:26 PM
What is wrong with this IF statement? need help. AC man Excel Discussion (Misc queries) 4 January 11th 06 03:29 PM


All times are GMT +1. The time now is 01:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"