Ver Mensaje Individual
  #1  
Antiguo 06-07-2014
maxi915 maxi915 is offline
Miembro
NULL
 
Registrado: jul 2011
Posts: 63
Reputación: 13
maxi915 Va por buen camino
capturar y mostrar registro dado entre 2 fechas

hola, una vez mas consultando por aca..
Necesito dado 2 fechas (desde y hasta) enviadas por parametro de tipo string, completar una stringgrid, este es el proceso que realize, pero no obtengo resultados, me trae la grilla vacia...

cuando fechaPago este entre esas fechas, obtener nombre apellido y telefono de ese cliente...alguna ayudita?gracias!!!

Código Delphi [-]
procedure buscarPagos(queryCliente:TADOQuery; desde,hasta:string; grilla:TStringGrid);
var
  i:Integer;
begin
with queryCliente do
    begin
      SQL.Clear;
      SQL.Add('Select * From Clientes Where FechaPago Between '+Desde+' and '+Hasta);
      Open;
          i:=1;
          grilla.RowCount:=RecordCount+1;
          while not Eof do
            begin
              grilla.Cells[0,i]:=fieldByName('nombre').AsString;
              grilla.Cells[1,i]:=fieldByName('apellido').AsString;
              grilla.Cells[2,i]:=fieldByName('telefono').AsString;
              i:=i+1;
              Next;
            end;
      ExecSQL
    end;
end;
Responder Con Cita