Ver Mensaje Individual
  #3  
Antiguo 09-02-2011
Avatar de microbiano
microbiano microbiano is offline
Miembro
 
Registrado: sep 2008
Ubicación: Mexico D.F
Posts: 349
Reputación: 18
microbiano Va por buen camino
Gracias

Me Respondo, revisando la consulta tuve un error grave, quedo de la siguiente manera el error lo pongo en engritas y otro color.
Código Delphi [-]
procedure TFcobro.ultimo_pago;
var wcontrato_meses:string;
 wanio_ejercicio:string;
begin
 wanio_ejercicio:=FormatDateTime('yyyy',Date);
 wcontrato_meses:=Trim(Self.txtcontrato.Text);

 if wcontrato_meses<>'' then
  begin
    with fmodulo.Qry_Temp do
     begin
       sql.Clear;
       SQL.Add('SELECT contrato,anio, Max(Fecha) AS Fecha');
       sql.Add('from recibo');
       sql.Add('group by contrato,anio');
       sql.Add('having (((contrato)=:Pcontrato) and ((anio)=:Panio))');
       Parameters.ParamByName('Pcontrato').Value:=Trim(wcontrato_meses);
       Parameters.ParamByName('Panio').Value:=Trim(wanio_ejercicio);
       try
        //open;
        Self.txt2.Text:=SQL.Text;
        Open;
        if not Fmodulo.Qry_Temp.IsEmpty then
         begin
          while not Fmodulo.Qry_Temp .Eof do
           begin
             self.L_ultimaFechaPago.Caption:=DateToStr(FieldByname('Fecha').AsDateTime);
             Next;
           end;
         end;  
       except
        on e: EoleException do
         begin
          MessageDlg(Format('Error: %s    Codigo: %d', [E.Message, E.ErrorCode]), mtError, [mbOK], 0);
         end;
       end;  
     end;  
  end;
end;

Última edición por microbiano fecha: 09-02-2011 a las 18:42:48. Razón: cambiar fuente
Responder Con Cita