Hola
Estoy seguro que el problema esta en el filtro, prueba esto:
Código Delphi
[-]
procedure Tfrm_cortedecaja.DateTimePicker1Change(Sender: TObject);
var
Filtro : String;
begin
adotable1.Active:=true;
if Adotable1.Locate('fecha',lbl_fecha.Caption,[]) = True then
begin
AdoTable1.Filtered := False;
Filtro := 'fecha = '+DateToStr(DateTimePicker1.date);
AdoTable1.Filter := Filtro;
AdoTable1.Filtered := True;
AdoTable1.Open;
Showmessage(AdoTable1.Fields[0].AsString); AdoQuery1.SQL.Text := 'Select sum(importe) as total from caja '+
' where fecha = :Fec '; AdoQuery1.Parameters[0].Value:= DateToStr(DateTimePicker1.date);
AdoQuery1.Active := true;
txt_total.Text := AdoQuery1.Fields[0].AsString;
end;
end;
O esto:
Código Delphi
[-]
procedure Tfrm_cortedecaja.DateTimePicker1Change(Sender: TObject);
var
Filtro : String;
begin
AdoQuery1.SQL.Text := 'Select sum(importe) as total from caja '+
' where fecha = :Fec '; AdoQuery1.Parameters[0].Value:= DateToStr(DateTimePicker1.date);
AdoQuery1.Active := true;
txt_total.Text := AdoQuery1.Fields[0].AsString;
end;
end;
Me cuentas como te va.
Saludos