Add Leading Zeros

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

Guest

I currently have a table with a field entitled LSTATUS which is in text
format. Some of the entries are '01', '02', '03', ... , '28', '29'. I need to
change the entries in this field so that they are in the form '001', '002',
'003', ... '028', '029' so that the table can then be exported to some
software. I'm sure there must be a relatively easy update query to run.

The format of the field needs to be text upon import and export from Access
and if these needs to be changed to run the update query, would also need
some additional information to ensure that the format change can be built
into a macro.

Thanks
 
Create a query into the table.

In the Field row or the query, enter:
Format([Field1], "000")
replacing Field1 with the name of your field.

Export the query.

If you prefer, you could change the query into an Update query (Update on
query menu), and change the values in the table using the same expression.
 
Back
Top