add '0' to the beginning of text string

Dave_epic

Registered User.
Local time
Today, 12:24
Joined
Mar 6, 2008
Messages
39
Hi

how can I write an update query which adds a '0' to the beginning of a text string in a column only if the text string has 4 characters. If the string is 5 characters I don't want the '0' added.

Thanks
 
I would look at the Format() function. Something like:
[YourField] = Format([YourField],"00000")
...off the top of my head, which could be all wet.
 
NewValue = Right("00000000" & Cstr([YourField]),5)

Where 5 is the number of characters that the new value should be.

David
 
Thanks

format worked great
Expr1: Format([Field1],"00000")

didn't check the other one yet.

Cheers.
 

Users who are viewing this thread

Back
Top Bottom