Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / DB Engine / SQL Server CE / February 2008

Tip: Looking for answers? Try searching our database.

How do I change sort order when all numeric values are in a text     field?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
The Mad Ape - 04 Feb 2008 15:12 GMT
I have this SQL:

Select ta_point from tblTally Group By ta_point

which gives:

1
10
2
21

etc

All values are numeric but it is a NVARCHAR field.

I tried:

Select ta_point from tblTally Group By ta_point Order By ta_point
which does not change results

Select convert(float, ta_point) from tblTally Group By ta_point Order
By ta_point which does not work

How do I do this to get:

1
2
10
21

Thanks

Mad Ape
ErikEJ - 04 Feb 2008 16:59 GMT
How about something like this:

SELECT CONVERT(float, ta_point) AS SortPoint from tblTally ORDER BY
SortPoint
Signature

Erik Ejlskov Jensen, Mobile App Dev MCTS
Check out my SQL Compact blog at
http://erikej.blogspot.com

>I have this SQL:
>
[quoted text clipped - 29 lines]
>
> Mad Ape
The Mad Ape - 04 Feb 2008 17:48 GMT
> How about something like this:
>
[quoted text clipped - 3 lines]
> Erik Ejlskov Jensen, Mobile App Dev MCTS
> Check out my SQL Compact blog athttp://erikej.blogspot.com

It works great.

Thanks.

The Mad Ape
www.tatumba.com
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.