Inner Outer Joins etc D7-ADO-Access2000
Can someone possibly help me with this, basically i'm try to do a left join with 3 tables, but i get a "Syntax error in from clause" error from Delphi. Here's the SQL i use:
query1.SQL.add('select [tbl1.id],[tbl1.name],[tbl1.surname],[tbl2.surname],[tbl2.name],[tbl3.name],[tbl3.surname],[tbl4.name],[tbl4.surname]');
query1.SQL.add('from person LEFT JOIN [tbl2],[tbl3],[tbl4]');
query1.SQL.add('ON [tbl2.id]=[tbl1.id] and [tbl3.id]=[tbl1.id] and [tbl4.id]=[tbl1.id]');
query1.sql.add('where [tbl1.id]=:variable order by [tbl1.name]');
Thanks
.
Relevant Pages
- translate SQL to Access
... I'm trying to translate the below query I had in SQL for use in Access. ... getting a syntax error (missing operator) in this clause ...LIKE CASE 'C' ... (microsoft.public.access.queries) - Re: ON ... AND statement problem
... long experience with SQL. ... it works with enough brackets. ... Finally because my different tests with WHERE gave me "syntax error" and ... clause I would try something else but would you be so kind to explain why, ... (microsoft.public.access.queries) - Multiple join types in one query, jet compatible, exec from Excel/
... tables, jet returns "join expression not supported", "syntax error in FROM ... Parameters - Need to maintain Excel/MS Query - Refresh External Data ... Goal - Perform Multiple join types in one query. ... use WHERE clause for join, however, do not want the risk of data being ... (microsoft.public.access.queries) - Re: Multiple join types in one query, jet compatible, exec from Excel/
... tables, jet returns "join expression not supported", "syntax error in FROM ... Parameters - Need to maintain Excel/MS Query - Refresh External Data ... Goal - Perform Multiple join types in one query. ... use WHERE clause for join, however, do not want the risk of data being ... (microsoft.public.access.queries) - SQL problem in script
... similar to VBS I thought that I should try my luck here. ... I don't see any syntax error in the FROM clause or am I missing ... Sub AddCompany() ... (microsoft.public.scripting.vbscript) |
|