numerical order

P

photo-er

Help! Within my 'number' field, Access sorts my numbers as 1,949 coming
before 150. How can I get it to sort numbers correctly?
 
D

Douglas J. Steele

Sounds as though your numbers are in a text field (as opposed to a numeric
field), or else you're using the Format function on them (as opposed to just
formatting the field), which converts them into text.

The ASCII representation for a comma is 44, which is smaller than any of the
digits (0 is 48, 1 is 49 and so on), therefore 1, comes before 15 when
sorting.

If this is a query and it is a text field, try creating a calculated field
to convert the text to an actual number (use either the CLng or Eval
functions), and sort on that field instead.
 
Top