Table Fields Required Length

  • Thread starter Thread starter AZEYE
  • Start date Start date
A

AZEYE

I have a table that I need to have one field always with
8 characters in it. It is a text field. I will be using
update queries to populate the field. But the data can be
anywhere from 3 characters in length to 8 characters in
length. What is updated into the field has to be right
justified with leading 0's to the left. For example if
the data inputted into the field is ABC the data in the
field should be "00000ABC" if the updated data is ABCDE
the field should be "000ABCDE".

Any ideas on how to do this?
Thanks in advance....
 
Thank you It works great....

-----Original Message-----
I think this should work for you:

Newfld:string(8-len([yourfld]),"0") & [yourfld]
-----Original Message-----
I have a table that I need to have one field always with
8 characters in it. It is a text field. I will be using
update queries to populate the field. But the data can be
anywhere from 3 characters in length to 8 characters in
length. What is updated into the field has to be right
justified with leading 0's to the left. For example if
the data inputted into the field is ABC the data in the
field should be "00000ABC" if the updated data is ABCDE
the field should be "000ABCDE".

Any ideas on how to do this?
Thanks in advance....
.
.
 
Back
Top