Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ORDER BY a string numerically ?

Status
Not open for further replies.

renepaulin

Technical User
Jan 31, 2005
6
CA
Hi all,

Is it possible to order a query by a string but to order it numerically instead of alphabetically. I tried to convert the string to a number with no luck.

Right now I am getting:

1,10,11,12,13,14,15,16,17,18,19,2,20,21 ...

I want

1,2,3,4,5,6,7,8,9,10,11 ...

Thanks

Rene
 
if the string is ALWAYS numeric,
...
ORDER BY INT([your string field])...

traingamer
 
You may also try this:
ORDER BY Val([your string field])

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top