Ver Mensaje Individual
  #10  
Antiguo 16-07-2007
Avatar de jhonny
jhonny jhonny is offline
Jhonny Suárez
 
Registrado: may 2003
Ubicación: Colombia
Posts: 7.058
Reputación: 30
jhonny Va camino a la famajhonny Va camino a la fama
Como no se de access, pues modificare un poquito la función de Contraveneno:
Código Delphi [-]
 
var
  CampoConCeros: string;
begin
  with TuQuery do
  begin
    If active then
      close;
    SQL.Clear;
    SQL.Add('Select Campo');
    SQL.Add('From Tabla');
    SQL.Add('Where campo = 1');
    Open;
    if Not IsEmpty then begin //sí se encontró el campo
      CampoConCeros := StringOfChar('0', 5 - Length(FieldByName('Campo').AsString))+FieldByName('Campo').AsString;
  end; //with
end;
__________________
Lecciones de mi Madre. Tema: modificación del comportamiento, "Pará de actuar como tu padre!"

http://www.purodelphi.com/
http://www.nosolodelphi.com/
Responder Con Cita