Solved

Access: LEFT JOIN error

Posted on 2009-06-29
4
231 Views
Last Modified: 2012-05-07
Hi x-perts,

I cannot figure out a syntax error (missing operator) on the second LEFT JOIN

what is wrong here?

Thanks
SELECT Funds.[Fund ID], Funds.[Fund Name], MID(Funds.[Fund Name], 1, 1) As F FROM Funds 

LEFT JOIN Quant1 ON (Quant1.[Fund ID] = Funds.[Fund ID]) 

LEFT JOIN Betas ON (Quant1.[Fund ID]=Betas.[Fund ID]) 

WHERE Funds.[open To Investment] = 'Yes' AND Betas.[MSCI in $] BETWEEN -0.08 AND 0.04

Open in new window

0
Comment
Question by:andy7789
  • 3
4 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 24734538
please try this (adding a couple of brackets)
SELECT Funds.[Fund ID], Funds.[Fund Name], MID(Funds.[Fund Name], 1, 1) As F 
FROM (Funds LEFT JOIN Quant1 ON (Quant1.[Fund ID] = Funds.[Fund ID])  )
LEFT JOIN Betas ON (Quant1.[Fund ID]=Betas.[Fund ID]) 
WHERE (Funds.[open To Investment] = 'Yes' AND Betas.[MSCI in $] BETWEEN -0.08 AND 0.04))

Open in new window

0
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 24734540
sorry, my post had a )) at the end, should have been )
SELECT Funds.[Fund ID], Funds.[Fund Name], MID(Funds.[Fund Name], 1, 1) As F 
FROM (Funds LEFT JOIN Quant1 ON (Quant1.[Fund ID] = Funds.[Fund ID])  )
LEFT JOIN Betas ON (Quant1.[Fund ID]=Betas.[Fund ID]) 
WHERE (Funds.[open To Investment] = 'Yes' AND Betas.[MSCI in $] BETWEEN -0.08 AND 0.04)

Open in new window

0
 

Author Comment

by:andy7789
ID: 24734647
Thank you! It works fine, though I cannot understand the error...  I have seen a lot of references with plain

LEFT JOIN Quant1 ON (Quant1.[Fund ID] = Funds.[Fund ID])
LEFT JOIN Betas ON (Quant1.[Fund ID]=Betas.[Fund ID])

etc in a row
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 24734705
ms access is picky about the brackets...
ms sql server does not require any brackets in that context.
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Viewers will learn how the fundamental information of how to create a table.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now