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

Sorting Records With Numbers 1

Status
Not open for further replies.

jt463

IS-IT--Management
Nov 23, 2005
134
Does anyone know a way I can get Access to sort records so 10 follows 9 instead of following 1?

My records are:

Cust-1, Cust-2,...,Cust-10

My sort shows:

Cust-1, Cust-10, Cust-2,...,Cust-9

Any help is greatly appreciated.
 
SQL snippet:
ORDER BY Val(Mid([yourField], 1+InStr([yourField],'-')))

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks Leslie and PHV.

PHV - your additional code worked perfectly.

Thanks to both of you for your time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top