inserting zeros behind a leading character

  • Thread starter Thread starter Klaas
  • Start date Start date
K

Klaas

I have a text field of with values like this (five characters maximum):

D321
D1234
R56
R9
T42

I try to update to this:

D0321
D1234
R0056
R0009
T0042

I wonder if this can be done in a single update query. Your advice will
be appreciated greatly.

Klaas
 
Klaas said:
I have a text field of with values like this (five characters maximum):

D321
D1234
R56
R9
T42

I try to update to this:

D0321
D1234
R0056
R0009
T0042

I wonder if this can be done in a single update query. Your advice will
be appreciated greatly.

On a *copy* of your table test something like...

UPDATE YourTableName
SET YourFieldName = Left(YourFieldName,1) & Right("0000" &
Mid(YourFieldName,2),4)
 
Rick,

Wonderful. You've solved in a split second what I couldn't figure out in
days :-)

Thank you.

Klaas


Rick Brandt wrote in microsoft.public.access.queries:
 
Back
Top