SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old April 8th, 2005, 11:15 AM
Sparafusile Sparafusile is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 2 Sparafusile User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 43 m 41 sec
Reputation Power: 0
Where's my error in this statement?

SELECT table1.*, table2.Name, table3.MaintenanceID FROM table1
INNER JOIN table2 ON table1.MachineID = table2.ID

LEFT JOIN table3 ON table1.SheetID = table3.ID

ORDER BY table2.Name




It works fine without the LEFT JOIN, but as soon as I add that clause in I get the following error:
Microsoft JET Database Engine error '80040e14'

Syntax error (missing operator) in query expression 'table1.MachineID = table2.ID LEFT JOIN table3 ON table1.SheetID = table3.ID'.

If someone could point out my mistake I'd appreciate it.


Spara

Reply With Quote
  #2  
Old April 8th, 2005, 07:29 PM
nofriends's Avatar
nofriends nofriends is offline
Senior Water Wizard
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Aug 2004
Location: Cape Town, RSA
Posts: 10,186 nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)  Folding Points: 112786 Folding Title: Super Ultimate Folder - Level 1Folding Points: 112786 Folding Title: Super Ultimate Folder - Level 1Folding Points: 112786 Folding Title: Super Ultimate Folder - Level 1Folding Points: 112786 Folding Title: Super Ultimate Folder - Level 1Folding Points: 112786 Folding Title: Super Ultimate Folder - Level 1Folding Points: 112786 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 2 Days 7 h 36 m 24 sec
Reputation Power: 699
Hi,

if you are using a access database, put the first inner join in brackets:
Code:
 SELECT table1.*, table2.Name, table3.MaintenanceID FROM table1
 (INNER JOIN table2 ON table1.MachineID = table2.ID)
 LEFT JOIN table3 ON table1.SheetID = table3.ID
 


hope this helps
__________________
Look! Its a ShemZilla



Reply With Quote
  #3  
Old April 11th, 2005, 08:58 AM
Sparafusile Sparafusile is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 2 Sparafusile User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 43 m 41 sec
Reputation Power: 0
Thanks for the help. Now when I run the statement, I get the following error:

Code:
Microsoft JET Database Engine error '80040e14' 

Syntax error in FROM clause.

I'm not sure why this is happening. BTW, I am using an access database.

Spara

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > Where's my error in this statement?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT