Solved

Access: LEFT JOIN error

Posted on 2009-06-29
4
236 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 eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

737 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