Hi,
It is often necessary to convert numeric fields to text, but you need to have leading spaces replaced with leading zeros. This often happens when you get data from another system that stores the data in a numeric format. A good example of this are zip codes. Another database might be storing the zip code for Boston (MA) as 2124, but it really should be "02124". If this numeric value were converted to text, we would end up with "2124" (LEFT JUSTIFIED!!!!).
Here's how to resolve this problem: 1) Make a backup copy of your table. 2) In Table design view, go ahead and convert the format to text and set the appropriate length. Save the table. 3) In Query, create a new query with the table just modified. Click on Query and change it to "Update Query". 4) Double-click on the field to be zero-filled. 5) For "Update to", enter code similar to this:
Format([zipcode],"00000")
Note: your fieldname must appear in brackets 6) Click on the Run button (exclamation mark in the top center of the Access window) to update all the records in your table.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.