Can I use an update query to add a digit?

  • Thread starter Thread starter Butch
  • Start date Start date
B

Butch

Using Access 97 -

I have a field that contains numbers manually entered from 001 to 999. Now I need more entries so I would like to
change the numbers to 4 digits (0001 to 0999). How do I add that first zero to all the existing numbers?
 
Using Access 97 -

I have a field that contains numbers manually entered from 001 to 999. Now I need more entries so I would like to
change the numbers to 4 digits (0001 to 0999). How do I add that first zero to all the existing numbers?

If the field datatype is number, you can't. Access does not store
leading zeros in a Number field.
You can simply format the field for display using
0000
as the format property.

If the field is Text datatype, you can update the field using an
Update query:

Update YourTable Set YourTable.FieldName = "0" & [FieldName];
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top