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

  • Thread starter Thread starter Anne Massard
  • Start date Start date
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
 
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)
 
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().
 
Back
Top