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 CampoConCeros := StringOfChar('0', 5 - Length(FieldByName('Campo').AsString))+FieldByName('Campo').AsString;
end; end;