I'm having a problem with oRS:Requery(). I have the SQL statment bellow:
- Code: Select all Expand view RUN
cSql := " SELECT mps.*,pes.nome FROM tmovgpes AS mps LEFT JOIN tpessoal AS pes ON mps.cmat=pes.cmat WHERE mps.data = ? AND mps.cequipto = ? AND mps.nequipe = ? ORDER BY funcao"
When I do:
- Code: Select all Expand view RUN
- oRs := oBD:Query( cSql, {dDataAtual,aVeiculos[1,1],aVeiculos[1,9]} )
everything is ok, But when I do:
- Code: Select all Expand view RUN
- oRs:Requery({dDataAtual, oQryMvg:cequipto,oQryMvg:nequipe})
There is happehing this error:
- Code: Select all Expand view RUN
- SELECT mps.*,pes.nome FROM tmovgpes AS mps LEFT JOIN tpessoal AS pes ON mps.cmat=pes.cmat WHERE data = '2022-04-07' AND cequipto = '00001' AND nequipe = 7 ORDER BY funcao;SHOW FULL COLUMNS FROM tmovgpes [ ERROR: Column 'cequipto' in where clause is ambiguous ]
I observed that in the error message, WHERE condition is different . Is missing field's ALIAS. Do you know why is it happening ?