Ver Mensaje Individual
  #15  
Antiguo 04-08-2011
Avatar de Caral
[Caral] Caral is offline
Miembro Premium
 
Registrado: ago 2006
Posts: 7.659
Reputación: 25
Caral Va por buen camino
Hola
Eso me dice que es posible que la fecha no la lea del datetimepicker ya que la lee como string, me parece.
Cambia esto a ver si envia un error:
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(Filtro); // aqui revisas que informacion te trae
 //en caso de encontrar productos vendidos realiza la suma
 AdoQuery1.SQL.Text := 'Select sum(importe) as total from caja '+
                       ' where fecha = :Fec '; // aqui esta tu semicolon
 AdoQuery1.Parameters[0].Value:=  Filtro;
 AdoQuery1.Active := true;
 txt_total.Text := AdoQuery1.Fields[0].AsString;
 end;
end;
Saludos
__________________
Siempre Novato
Responder Con Cita