Number sequence

C

Cindy at TRW

How do you keep data with numbers in their actual sequential number? I want
to sort data by a field that is a number format. The numbers are, for
instance, 1, 2, 4, 5, 6, 8, 13, 14, 19. When I sort, it puts them in this
order 1, 13, 14, 19, 2, 4 etc. That is not the order I want. Thanks
 
V

Van T. Dinh

It sounds like your "numbers" are actually Text since "2" comes after
"19...." in Text sorting.

Check the Data Type of the Field in the Table.
 
C

Cindy at TRW

Yes, it is set to text since I have text within the same field. Is there no
other way around this problem? I need to change the field to "number" - then
I will loose too much data.
 
V

Van T. Dinh

How do you want to sort Records with entries that cannot be converted to
numeric values?

You can use CInt or CLng to convert from text with digits to numeric values
but since the Field is of Text type. However, CInt / CLng will give you
error when the input to the function cannot be converted to numeric value.
You can use IIf and IsNumeric to partially circumvent this but this leads to
my question above.
 
Top