syntax error in update query

M

maxhodges

Have I forgotten something?

I'm getting this error message when I try to run the query below:

syntax error (missing operator) in query expression
'qpassFLT_FINMET_MONTHLY.tire_costs
FROM flt inner join qpassFLT_FINMET_MONTHLY on
flt.parent_FAC_IDU = qpassFLT_FINMET_MONTHLY.FAC_IDU.'


UPDATE flt
SET flt.tire_costs = qpassFLT_FINMET_MONTHLY.tire_costs
FROM flt inner join qpassFLT_FINMET_MONTHLY on
flt.parent_FAC_IDU = qpassFLT_FINMET_MONTHLY.FAC_IDU

maxhodges
 
J

John Vinson

Have I forgotten something?

I'm getting this error message when I try to run the query below:

syntax error (missing operator) in query expression
'qpassFLT_FINMET_MONTHLY.tire_costs
FROM flt inner join qpassFLT_FINMET_MONTHLY on
flt.parent_FAC_IDU = qpassFLT_FINMET_MONTHLY.FAC_IDU.'


UPDATE flt
SET flt.tire_costs = qpassFLT_FINMET_MONTHLY.tire_costs
FROM flt inner join qpassFLT_FINMET_MONTHLY on
flt.parent_FAC_IDU = qpassFLT_FINMET_MONTHLY.FAC_IDU

Yes: you have things out of order; the JOIN clause comes before the
SET and FROM clauses:

Try

UPDATE flt INNER JOIN qpassFLT_FINMET_MONTHLY on
flt.parent_FAC_IDU = qpassFLT_FINMET_MONTHLY.FAC_IDU
SET flt.tire_costs = qpassFLT_FINMET_MONTHLY.tire_costs;

FAC_IDU must be the Primary Key of flt (or have a unique index) for
this to work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top