Padding a string with characters

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to run a program that when I do a new import of customer data that I
want to pad the zip code and the plus 4 with zeros when the length is either
less than 5 or 4. In Visual Fox Pro there was a function called PAD that
could be used to pad a string with any desiganted ASCII char to a certain
length. I cannot seem to find that same function in Access. Does anyone
know a way around this? I would like to use it in an update query if at all
possible.

Thanks
 
ARRRGGGHHHH, I did not edit that statement in my last post, should be:
=zip & string(9-len(zip),"0")
 
Sorry if this is a repeat, Jeff, got an error posting.

Use the String function. It is almost identical to the PAD function in
Foxpro:
=zip & string(9-len(zip),"00")
 
Use the String function. It is almost identical to the Pad in Foxpro.
=strZip & string(9-len(strZip),"0")
 
Back
Top