order by

J

Judy

I need to order a text field ascending numeric--in other
words, 1, 2, 3, 110, 113 etc. NOT as text does it: 1,
110, 113, 2, 3, etc.

How do I do that?


--Judy
 
J

John Vinson

I need to order a text field ascending numeric--in other
words, 1, 2, 3, 110, 113 etc. NOT as text does it: 1,
110, 113, 2, 3, etc.

How do I do that?

In a vacant Field cell in your query type

SortKey: Val([fieldname])

and sort by this calculated (numeric) field.
 
J

John Spencer (MVP)

SELECT *
FROM TABLE
ORDER BY Val(YourTextFieldWithNumbers)

Or if the is ALWAYS a value in the field.

ORDER BY CDbl(YourTextFieldWithNumbers)
 

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