Click here to Skip to main content
15,746,420 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi, Iam using vs2010, Access 2010. I have Access DataBase with 4 Tables. I wish to have a select query from all other tables as required...Is it possible?

Thanks For The Helps

My Query :-
===========
C#
Select iv.*,pt.pty_name,cm.commodity,it.itm_description,cy.company_name from (invoicetbl iv left join partytbl pt on iv.pty_code=pt.pty_code left join commodity cm on iv.commodity_id=cm.commodity_id left join itemtbl it on iv.itm_code=it.itm_code) left join companytbl cy on iv.company_id=cy.company_id where Len(Trim(iv.inv_year))>0 order by iv.invoice_no,iv.line_no


When I execute the above query receiving the error like
C#
Syntax error (missing operator) in query expression iv.pty_code=pt.pty_code
 left join commodity cm on iv.commodity_id=cm.commodity_id left join itemtbl it on iv.itm_code=it.itm_code


Thanks Again
Posted
Updated 9-Aug-14 6:27am
v2
Comments
OriginalGriff 9-Aug-14 11:48am    
"Is it possible?"
No idea.
What happens when you try it?

Remember we can't see your screen, access your HDD, or read your mind - so we have no idea what table contains what, and how they interrelate. So working out what your query does is pretty much impossible - particularly since we have no idea what you are expecting or getting!

Use the "Improve question" widget to edit your question and provide better information.
Paramu1973 9-Aug-14 12:23pm    
Getting the Error like Syntax Error (missing operator) in query operator iv.pty_code=pt.pty_code left join commodity cm on iv.commodity_id=cm.commodity_id left join itemtbl it on iv.itm_code=it.itm_cod.
Thanks

1 solution

Remove the brackets.
SQL
Select iv.*,pt.pty_name,cm.commodity,it.itm_description,cy.company_name from invoicetbl iv left join partytbl pt on iv.pty_code=pt.pty_code left join commodity cm on iv.commodity_id=cm.commodity_id left join itemtbl it on iv.itm_code=it.itm_code left join companytbl cy on ...
 
Share this answer
 
Comments
Paramu1973 9-Aug-14 21:39pm    
Receiving the same error like
Syntax error (missing operator) in query expression iv.pty_code=pt.pty_code
left join commodity cm on iv.commodity_id=cm.commodity_id left join itemtbl it on iv.itm_code=it.itm_code) left join companytbl cy on iv.company_id=cy.company_i.
Thanks Again

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900