Prueba esta función que uso a menudo, ten encuenta que tipo es el campo, debe ser String
Código Delphi
[-][ function ceros(text:string;Cant:integer):string; EJEMPLO
a2:=ceros(inttostr(32),4);
a2 = 0032
}
function ceros(text:string;Cant:integer):string; var
valor,x:integer;
dev,con:string;
begin
con:='';
valor:=length(text);
if valorthen
begin
for x:=1 to (cant-valor) do
begin
con:=con+'0';
end;
dev:=con+text;
end
else
dev:=text;
result:=dev;
end;