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

Order by using numbers 1

Status
Not open for further replies.

rtshort

IS-IT--Management
Feb 28, 2001
878
US
I have a TaxRate table that I fill a ComboBox with. In the sql statement I use "order by TaxRate" but it comes out wrong:

1.0
10.0
2.0
3.0
4.0
5.0
6.0
7.0
8.0
9.0

The 10.0 comes right after the 1.0. How do I get the 10.0 to come after the 9.0 like it should? Like:

1.0
2.0
3.0
4.0
5.0
6.0
7.0
8.0
9.0
10.0
11.0
etc....
Rob
Just my $.02.
 
Tax rate seems to be stored as text...

TRY This (sql Server)

SELECT cast(taxrate as int) FROM myTable ORDER BY cast(taxrate as int)

(Access)
SELECT cInt(taxrate) FROM myTable ORDER BY cInt(taxRate)

-- Just trying to help...
[wolf]<--- This is a wolf? We need a new icon.......
mikewolf@tst-us.com
 
Thanks Wolf, been away from the computer for a while. Rob
Just my $.02.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top