Add Leading Zeros To Alphanumeric Text (1 Viewer)

Micheleaz

New member
Local time
Yesterday, 18:07
Joined
Aug 29, 2006
Messages
6
I'm learning as I go and this is probably a basic question but if I have an alpha numeric field of variable lenght, i.e. AUI856Z....how to I format it so that it is 19 characters long with leading zeros, i.e. 000000000000AUI856Z.:confused:
 
Try

Format(FieldName,"0000000000000000000")
 
uggggg....it didn't work. It right justified everything but didn't put the zero's in. Does it not like adding leading zero's to alpha?
 
Sorry; that works for numbers, I've never tried it on alphanumeric. This works, though it's a kludge:

Replace(Format([password],"@@@@@@@@@@@@@@@@@@@")," ","0")
 
Hi -

Look in the Help File under Space() function. If that doesn't work for you please post back. Can provide a slightly more complicated UDF that will insert necessary characters either in front of, or behind of, the string in question.

Best wishes - Bob
 

Users who are viewing this thread

Back
Top Bottom