-2

I am attempting to eliminate unwanted duplicate query results. The gist is that the field [CUSIP] exists in all tables in question, however, the field [4DTYR] exists in all tables except [IDX_FS].

I had previously only joined the tables via the [CUSIP] field, and that resulted in the query produced unwanted duplicate results (some sort of a permutation of [4DTYR] from all the tables that contained that field).

Then, I made the modification below. However, now I'm receiving a JOIN syntax error. Can anyone kindly help? I've reposted just in case this Q got a little bit stale. Thanks!

FROM 

(((IDX_FS LEFT JOIN DATA_BS 
  ON IDX_FS.CUSIP = DATA_BS.CUSIP) 

LEFT JOIN DATA_Footnotes 
  ON IDX_FS.CUSIP = DATA_Footnotes.CUSIP) 

LEFT JOIN DATA_IS 
  ON IDX_FS.CUSIP = DATA_IS.CUSIP) 

LEFT JOIN DATA_SP 
  ON IDX_FS.CUSIP = DATA_SP.CUSIP 

AND (((DATA_BS LEFT JOIN DATA_IS 
  ON DATA_BS.CUSIP = DATA_IS.CUSIP 
     AND DATA_BS.4DTYR = DATA_IS.4DTYR) 

LEFT JOIN DATA_SP 
  ON DATA_BS.CUSIP = DATA_SP.CUSIP 
     AND DATA_BS.4DTYR = DATA_SP.4DTYR) 

LEFT JOIN DATA_Footnotes.4DTYR 
  ON DATA_BS.CUSIP = DATA_Footnotes.CUSIP 
     AND DATA_BS.4DTYR = DATA_Footnotes.4DTYR
2
  • I get "missing operator" syntax error.... Commented Oct 20, 2013 at 0:22
  • Don't repost questions just because you don't get an answer immediately. You've asked the same here and here. Commented Oct 20, 2013 at 0:39

1 Answer 1

0

Looks like your error is here

LEFT JOIN DATA_Footnotes.4DTYR -- this is not a valid table name
  ON DATA_BS.CUSIP = DATA_Footnotes.CUSIP 
   AND DATA_BS.4DTYR = DATA_Footnotes.4DTYR

removing the .4DTYR should fix your error

LEFT JOIN DATA_Footnotes
  ON DATA_BS.CUSIP = DATA_Footnotes.CUSIP 
   AND DATA_BS.4DTYR = DATA_Footnotes.4DTYR
Sign up to request clarification or add additional context in comments.

1 Comment

That's a legit error. However, I made the change and I'm still getting a missing operator error. Should I be using UNION to connect two SELECT statements instead?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.