Solved

Access: LEFT JOIN error

Posted on 2009-06-29
4
237 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

724 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