Remove Leading Zero's

  • Thread starter Matt via AccessMonster.com
  • Start date
M

Matt via AccessMonster.com

I am working with a legacy system. The data comes to me with leading zero's.
The number of zeros varies so using a query and doing a left([FieldName],4)
or right([Fieldname],4) wont work.

Does anyone have any suggestions.

Thanks
Matt
 
J

John Spencer

Take a look at the VAL function. That converts a string to a number (which
should remove leading and trailing zeroes).
 
M

Matt via AccessMonster.com

Yes - That works...

Thank you

John said:
Take a look at the VAL function. That converts a string to a number (which
should remove leading and trailing zeroes).
I am working with a legacy system. The data comes to me with leading zero's.
The number of zeros varies so using a query and doing a left([FieldName],4)
[quoted text clipped - 4 lines]
Thanks
Matt
 
F

fredg

I am working with a legacy system. The data comes to me with leading zero's.
The number of zeros varies so using a query and doing a left([FieldName],4)
or right([Fieldname],4) wont work.

Does anyone have any suggestions.

Thanks
Matt

If the Format property of the field is NOT 0000000 (as many 0's as the
number of characters permitted in the field), then since the Access
Number datatype does not store nor display leading zero's, it must be
a Text datatype field.
=Val([FieldName])
will return the number value of the text field, without the leading
zero's.
 

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