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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sort sequence question in a query 2

Status
Not open for further replies.

cookie5

Programmer
Jan 19, 2003
47
US
I have a table with a location field as a text field. I am wanting to sort on the field in accending order but when I do I get results that I am not expecting.
Here is what I get:
A10A
A11A
A12A
A13A
A1A
A2A

Here is what I hoped for:
A1A
A2A
A10A
A11A
A12A
A13A

The field is never more that 4 in length, if that matters. Any help would be greatly appreciated.
 
You must create an aditional field with number format from the location field but without the letters.
and then sort by the new field.
try using the left anf righ functions to do this.
 
Try
Code:
ORDER BY Val(Mid([myField],2)), [myField]

[small]No! No! You're not thinking ... you're only being logical.
- Neils Bohr[/small]
 
Thanks Golom and kobooky! You guys are great, it worked just like I need it to.[2thumbsup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top