Sort Ascending

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I know there is a simple solution. When I sort ascending I get
1
10
11
12
down to the 199 and then it goes to
2
20
21
and so on how can I get it to just go 1, 2, 3, 4 and so on.
 
Your "numbers" actually are text values, not numeric values. Change your
ORDER BY clause in the query to this:

ORDER BY Val([NameOfThatField])
 
That's because your numbers are text. Change the datatype in your table to
an appropriate Number datatype.

Alternatively, add a new field to your query, and enter either:
CInt([YourTextNumberField])
if the "numbers" are all integers (as seems likely from the examples you
posted), or
CDbl([YourTextNumberField])
if the "numbers" contain decimal portions.

Sort on the calculated field. You do not need to show it if you don't want
to. Or you can show the calculated field and not the original text field.
Note that text fields display left-aligned, and number fields display
right-aligned (default, you can change in textbox controls).

HTH,

Rob
 

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

Back
Top