Way to get number field to accept the number "001"?

A

Anne Massard

Hi,

Is there a way to get a number field to accept a number such as "001"
rather than truncating it to "1"?

Alternatively, is there a way to get a text field to sort numbers
properly? If you try to sort ascending a text field containing
numbers it gets it half right:

001
005
107
1085
109
2003
215


Any help would be appreciated!

Thanks,
Patricia
 
A

Ashby

I do not know how to get a number field to store a number
with leading zeros.

However, to get numbers in a text field to sort
numerically ( I assume in a query):
Use "CLng"

i.e. Clng(textfield)
 
J

John Vinson

Is there a way to get a number field to accept a number such as "001"
rather than truncating it to "1"?

No.

A Number is stored as binary digits. 001 and 1 and 0000000000001 are
just different ways of depicting the exact same number.
Alternatively, is there a way to get a text field to sort numbers
properly? If you try to sort ascending a text field containing
numbers it gets it half right:

If you want to sort numerically, put in a calculated field

Val([textfield])

and sort by it. If you want 001 to sort before (or after) 0001 you'll
also want to sort by the textfield itself, after the sort by Val().
 

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