I have two tables: turno and richieste.
In the TQuery component, I have the following SQL code:
In SQL.Text:
SELECT
t.settimana,
t.anno,
t.numero_fascicoli,
t.con_assistente,
t.start_sede,
t.end_sede,
t.ref_operatore,
t.ref_assistente,
r.*
FROM turno t
LEFT JOIN richieste r ON t.ref_richieste = r.id
And in UpdateSQL.Text:
UPDATE turno t
LEFT JOIN richieste r ON t.ref_richieste = r.id
SET
t.settimana = :settimana,
t.anno = :anno,
t.numero_fascicoli = :numero_fascicoli,
t.con_assistente = :con_assistente,
t.start_sede = :start_sede,
t.end_sede = :end_sede,
t.ref_operatore = :ref_operatore,
t.ref_assistente = :ref_assistente,
r.ref_richiedente = :ref_richiedente,
r.data_start = :data_start
WHERE t.id = :id
I have a DBGrid on the form linked to the TQuery as a data source. But when I update a value in the DBGrid and press post on the DBNavigator, Lazarus gives a database error specifically "DATABASE: near "t": sytax error."
can anyone help me?