Hola!
Ahora como le hago si el usuario selecciona la tabla mediante un combobox y quiero hacer la consulta entre dos fechas, lo que yo hago es lo siguiente pero me marca un error:
Código Delphi
[-]
table1.Active:=false;
table1.TableName:=combobox1.Items[combobox1.ItemIndex];
table1.Active:=true;
case combobox1.ItemIndex of
0:begin
Query1.SQL.Text:='select * from Aluminio where Fecha = between : Fecha1 and : Fecha2';
Query1.Params[0].AsDate:=datetimepicker1.Date;
Query1.Params[1].AsDate:=datetimepicker2.Date;
Query1.Active := true;
Query1.Open;
end;
end;
Estoy ocupando un solo dbgrid, un table y un query estoy bien?
Gracias