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 on varchar field

Status
Not open for further replies.

lhg1

IS-IT--Management
Mar 29, 2005
134
DK
Hi

I want to order by a field - that contains a number. But the DB field is a varchar insted of an intiger.

This is my sql
Code:
select field1, field2 
from table
order by field1

the result is
field1 field1
1 the first
10 number ten
2 the secound.

it should be

field1 field1
1 the first
2 the secound.
10 number ten

Does anyone know how to sort by number?

Thanks
LHG
 
Excelent - it works.

Thanks

LHG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top