Adding Leading zeros

N

Nat

How do you add leading zeros to certain cells via an
update query? I found this recommendation Right
([original_num]+1000000,6), however, when I run the update
query it only keeps the original_num values and does not
add any leading zeros.
 
R

Rick Brandt

Nat said:
How do you add leading zeros to certain cells via an
update query? I found this recommendation Right
([original_num]+1000000,6), however, when I run the update
query it only keeps the original_num values and does not
add any leading zeros.

You can only *store* leading zeros in a text field. Sounds like you are
using a number field.

You can *display* leading zeros using the format property. I have never
seen a case in any of my apps where this was not sufficient.
 
G

George Nicholson

If you are working with a field who's DataType is set to Number, an update
query will do you no good. Change the Format property of the field to
00000.000 or however you want it to display. This doesn't change the values
that are stored, it just changes how they are displayed.

The update query you describe would only work on the characters in a field
who's DataType is set to Text.

Number fields won't store leading zeros (although you can force them to be
displayed). Text fields will store leading zeros.

Hope this helps,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top