|
-
Sep 26th, 2007, 12:48 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] [2005] SQL Syntax
I'm trying to select info from multiple tables and this isn't working:
Code:
"SELECT distinct Production.API " _
& "FROM (well_header JOIN production)" _
& "WHERE Not production.api = well_header.api" _
& "ORDER BY Production.API;"
I originally had this because I know that it does work for sure but when I put it in VB, I get a syntax error stating the join isn't correct but it works when I execute it from Access
Code:
"SELECT distinct Production.API " _
& "FROM (well_header, production)" _
& "WHERE Not production.api = well_header.api" _
& "ORDER BY Production.API;"
Any ideas anybody??
Using Visual Studio 2008
Please mark your thread RESOLVED if you no longer need help.
-
Sep 26th, 2007, 12:59 PM
#2
Re: [2005] SQL Syntax
Moved to Database Development
Are you trying to select something from one table that IS NOT in another table?
-
Sep 26th, 2007, 01:07 PM
#3
Re: [2005] SQL Syntax
Is this what you are tring?
Select Production.API From Production Where Production.API Not In (Select well_header.api From Well_Header) Order By Production.API
Sometimes the Programmer
Sometimes the DBA
Mazz1
-
Sep 26th, 2007, 01:19 PM
#4
Thread Starter
Fanatic Member
Re: [2005] SQL Syntax
Yes, I'm trying to select data that is in the Production table but not in the wellHeader table
Using Visual Studio 2008
Please mark your thread RESOLVED if you no longer need help.
-
Sep 26th, 2007, 01:35 PM
#5
Re: [2005] SQL Syntax
Gary went in the direction I was intending to go. Have you tried his suggestion?
-
Sep 26th, 2007, 01:39 PM
#6
Thread Starter
Fanatic Member
Using Visual Studio 2008
Please mark your thread RESOLVED if you no longer need help.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|