Join Expression Not Supported. In SQL

Soma_rich

Registered User.
Local time
Today, 05:44
Joined
May 2, 2007
Messages
58
I am running the below using a function that sets up the recordset and connects to a database. I know this bit works as I use it all through the DB. The only differance in the below is that it is a more complex query envooving left joins. Can I use a left join like this in a recordset?

Code:
selectQry "TOP 5 Tbl_QC_Results.Matches, Tbl_QC_Results.NoMatches, Tbl_QC_Results.AQL1_Errors, Tbl_QC_Results.AQL2_Errors, tbl_ed_Production_New.Last_QC, tbl_ed_Production_New.QC_Flag, tbl_ed_Production_New.EmpId," & _
"tab.MATCHED", "Tbl_QC_Results LEFT JOIN ((tbl_ed_Production_New LEFT JOIN Block_Definitions ON tbl_ed_Production_New.Block_Name = Block_Definitions.Txt_Block_No) LEFT JOIN tab " & _
"ON Block_Definitions.Nmb_Block_No = AI_CAND_MTN_AI_VOA_CANDIDATE_LIST.JOB_ID) ON Tbl_QC_Results.Block_Number = tbl_ed_Production_New.Block_Name ", " (((tbl_ed_Production_New.Last_QC) Like '[0-9]0') AND " & _
" ((tbl_ed_Production_New.EmpId)= " & [Forms]![Frm_new_QC_Entry_Form]![TxtempID] & " )) OR (((tbl_ed_Production_New.EmpId)= " & [Forms]![Frm_new_QC_Entry_Form]![TxtempID] & " ) AND ((tab.MATCHED)='A')) OR (((tbl_ed_Production_New.QC_Flag) Is Null) AND ((tbl_ed_Production_New.EmpId)= " & [Forms]![Frm_new_QC_Entry_Form]![TxtempID] & " ));"
 
Again with the unreadable darn SQL... can you please tidy up your SQL before posting it!

*Geez*

After cleaning up your sql, I notice it is not proper SQL... i.e.
- SelectQry???
- No from
So maybe we need to look at the function as well...

Code:
 Tbl_QC_Results 
 LEFT JOIN ((tbl_ed_Production_New 
             LEFT JOIN Block_Definitions ON tbl_ed_Production_New.Block_Name = Block_Definitions.Txt_Block_No) 
                       LEFT JOIN [B]tab[/B]     ON Block_Definitions.Nmb_Block_No   = [B]AI_CAND_MTN_AI_VOA_CANDIDATE_LIST[/B].JOB_ID) 
 ON Tbl_QC_Results.Block_Number = tbl_ed_Production_New.Block_Name

You are not joing the "TAB" table properly, is what it looks like to me...
 
The pasted query doesn't make any sense.
Put a breakpoint past this line and execute it.

echo the variable in your immediate window, cut and paste the result in a new query
now you can start to debug it.

HTH:D
 

Users who are viewing this thread

Back
Top Bottom