(see previous post as well - inner joins via SQL) I'm trying to get an outer join (not inner join as I originally said - hence the repost) working with access. However my SQL, which works fine with mySQL server doesn't work with access. lupins46 suggested adding a few brackets to the statement, but I still get an error.
here is my original SQL
select
l.job_parts_id,
l.part_id,
l.oil_id,
l.quantity,
l.purchase_price,
l.sale_price,
p.part_no,
p.description,
p.supplier_id,
o.part_no,
o.description,
o.supplier_id
from job_parts l
left outer join parts p
on l.part_id = p.part_id
left outer join oil o
on l.oil_id = o.oil_id
where l.task_id = 1
order by l.job_parts_id
Here is the SQL at the moment, with the brackets suggested by lupins46...
select
l.job_parts_id,
l.part_id,
l.oil_id,
l.quantity,
l.purchase_price,
l.sale_price,
p.part_no,
p.description,
p.supplier_id,
o.part_no,
o.description,
o.supplier_id
from (job_parts l
left outer join parts p
on l.part_id = p.part_id)
left outer join oil o
on l.oil_id = o.oil_id
where l.task_id = 1
I have tried writing a query in access to test this but I'm getting an syntax error and I'm at a loss as to what the problem is.
Here is the access version of the above:
SELECT
job_parts.job_parts_id,
job_parts.part_id, job_parts.oil_id, job_parts.purchase_price,
job_parts.sale_price,
job_parts.quantity,
parts.part_id,
parts.description,
parts.supplier_id,
oil.oil_id,
oil.description,
oil.supplier_id,
job_parts.task_id
FROM (job_parts
OUTER JOIN oil ON
job_parts.oil_id = oil.oil_id)
OUTER JOIN parts ON
job_parts.part_id = parts.part_id
WHERE ((job_parts.task_id)=1);
which as far as I can tell is the same as my (faulty) SQL version.
I cannot see what the syntax error could be or why my original SQL is incorrect.
Looking for a job as a programmer in Bristol UK.
here is my original SQL
select
l.job_parts_id,
l.part_id,
l.oil_id,
l.quantity,
l.purchase_price,
l.sale_price,
p.part_no,
p.description,
p.supplier_id,
o.part_no,
o.description,
o.supplier_id
from job_parts l
left outer join parts p
on l.part_id = p.part_id
left outer join oil o
on l.oil_id = o.oil_id
where l.task_id = 1
order by l.job_parts_id
Here is the SQL at the moment, with the brackets suggested by lupins46...
select
l.job_parts_id,
l.part_id,
l.oil_id,
l.quantity,
l.purchase_price,
l.sale_price,
p.part_no,
p.description,
p.supplier_id,
o.part_no,
o.description,
o.supplier_id
from (job_parts l
left outer join parts p
on l.part_id = p.part_id)
left outer join oil o
on l.oil_id = o.oil_id
where l.task_id = 1
I have tried writing a query in access to test this but I'm getting an syntax error and I'm at a loss as to what the problem is.
Here is the access version of the above:
SELECT
job_parts.job_parts_id,
job_parts.part_id, job_parts.oil_id, job_parts.purchase_price,
job_parts.sale_price,
job_parts.quantity,
parts.part_id,
parts.description,
parts.supplier_id,
oil.oil_id,
oil.description,
oil.supplier_id,
job_parts.task_id
FROM (job_parts
OUTER JOIN oil ON
job_parts.oil_id = oil.oil_id)
OUTER JOIN parts ON
job_parts.part_id = parts.part_id
WHERE ((job_parts.task_id)=1);
which as far as I can tell is the same as my (faulty) SQL version.
I cannot see what the syntax error could be or why my original SQL is incorrect.
Looking for a job as a programmer in Bristol UK.