Solved

Access: LEFT JOIN error

Posted on 2009-06-29
4
235 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 143

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 143

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 143

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

740 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