Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"syntax error in join operation" error 1

Status
Not open for further replies.

Ashank4vba

Programmer
Apr 29, 2005
115
IN
Hello,

Can you help me find why I'm getting a "syntax error in join operation" error when I try to execute the following query?
After I press 'ok' in the error dialog box, the first occurrence of 'BndCORE_save' is highlighted.
Thanks in advance.
The query is as follows:
Code:
SELECT

 *,-999 As BndPropCORE_ID FROM 

	(
	SELECT BndCORE_save.Cusip_No, BndCORE_save.BndCORE_ID, 	BndCORE_save.Prdc_Typ, BndCORE_save.Orig_Pur_Amt, 	BndAddlCORE_save.HCDGrp_ID AS HCDIssueNo, BndAddlCORE_save.Stlm_dt AS 	Clsng_Dt, BndAddlCORE_save.OrigInt_Rt FROM BndCORE_save INNER JOIN 	BndAddlCORE_save ON 	BndCORE_save.BndCORE_ID=BndAddlCORE_save.BndCORE_ID WHERE 	
	(
	(
	(BndAddlCORE_save.Stlm_dt) Is Not Null
	)
	)
	) 
LEFT JOIN 
	(
	SELECT c_qry.CtrptyCORE_ID, 	c_qry.Ctrpty_Nme, c_qry.Tx_ID, 	EntyCtrptyJOIN_save.Enty_ID, 	EntyCtrptyJOIN_save.Ctrpty_Role, 	Ref_CPList_Aux_tbl.Role_Desc, EntyCtrptyJOIN_save.EntyJoinTyp FROM 	
	(
	(
	Ref_CPList_Aux_tbl INNER JOIN EntyCtrptyJOIN_save ON 	Ref_CPList_Aux_tbl.Ctrpty_Role = EntyCtrptyJOIN_save.Ctrpty_Role
	) 
	INNER JOIN  	
	CtrptyCORE_save As c_qry ON EntyCtrptyJOIN_save.CtrptyCORE_ID = 	c_qry.CtrptyCORE_ID
	)
	 WHERE 
	(
	(
	(
	EntyCtrptyJOIN_save.EntyJoinTyp
	)
	 = IIf
	(Ref_CPList_Aux_tbl.Join_Type=-	999,EntyCtrptyJOIN_save.EntyJoinTyp,Ref_CPList_Aux_tbl.Join_Type
	)
	) 
	And 	
	(
	(Ref_CPList_Aux_tbl.Uses_BndPropCORE)=No
	) And (Ctrpt
	y_Nme Is Not Null))) 

ON BndCORE_save.BndCORE_ID =  EntyCtrptyJOIN_save.Enty_ID

-cheers
Ashank
 
The inline subqueries must have an alias:
SELECT * FROM (SELECT ....) As A

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top