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!

Use SQL to sort mixed data 1

Status
Not open for further replies.

JOD59

Technical User
Dec 17, 2003
39
US
Does anyone know how I could sort this type of data on the first 4 digits; this is a text field. I would like to use SQL to do it. Thanks for all help.

1170
60
1745/1160/870/570
850
1730
3600
3600
3
3500
5
 
For the field that contains the values you wish to sort
apply the Val function in another field.

In my case I used the values you provided in my table.

1170
60
1745/1160/870/570
850
1730
3600
3600
3
3500
5


In the query I simply added a field and applied the Val function to the field that contained the data and had the query sort in ascending order.

The result -


Data Number <- This field is defined as
3 3 Number:Val([Data])
5 5
60 60
850 850
1170 1170
1745/1160/870/570 1745
3500 3500
3600 3600
3600 3600
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top