add filler zeroes

broadbean

Registered User.
Local time
Today, 14:54
Joined
Oct 24, 2007
Messages
15
I have a table that I need to update. The field is alphanumeric and goes like

Dc0001
Dc0002
Dc0003
Dc0004

I want to add an extra 0 onto them so would be

Dc00001
Dc00002
Dc00003
Dc00004

As there are a few thousand records like this I don't want to do it manually and just wandered how would I do this in an update query or I would I need some VB code. Thanks for any help
 
left([field1],2) & "0" & mid([field1],3)

Cannot test as I no longer have Access but does the above expression work in an update query, assuming your field is field1. Remember to take a backup before trying any update.

Brian
 
Last edited:
works a treat brian. I used an update query and works fine

many thanks
gaz
 

Users who are viewing this thread

Back
Top Bottom