2 TADOQUERY master and Detail tablefilter insert
- by ml
How can i work with 2 Tadoquery and work like a Tadoquery (master) Tadotable(detail) !!
var tempvar : Variant;
begin
Edit1.text:=Ano.value;
Begin
with Ano_planeamento do //Laço de consulta por codigo
Begin
Close;
SQL.Clear;
SQL.Add('SELECT * from planeamento_ano');
SQL.Add('Where ano LIKE ''%'+Edit1.text+'%''');
Open;
end;
end;
tempvar := Ano_planeamento.fieldbyname('ano').value;
planeamento.close;
if tempvar <> null then
begin
planeamento.SQL.Clear;
planeamento.SQL.add('SELECT * FROM planeamento');
planeamento.SQL.add(' WHERE ano = ');
planeamento.SQL.add('''' + tempvar + '''');
// here i nead to filter by ....
planeamento.open;