回复 2楼 vtefhvk1975
var
query1:Tadoquery;
begin
query1:=Tadoquery.Create(nil);
query1.Connection:=datamodule1.ADOConnection1;
begin
with query1 do
begin
close;
sql.Clear;
sql.Add('select * from 凭证1 where 年=:p1 and
月=:p2 ');
parameters.ParamByName('p1').Value:=datetimepiker1.date;
parameters.ParamByName('p2').Value:=datetimepiker2.date;
open;
end;
end;
end;