Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 sorting of data on field having type varchar(30)

Author  Topic 

kusum
Starting Member

1 Post

Posted - 2011-01-07 : 05:26:32
I have an CustomerLine table where the LineId is defined as VarChar(30).LineId contains only Numeric data.
My problem is getting the LineId to list in sequence in ascending Order.
This query is giving wrong results.

select LineId from CustomerLine
order by CAST( lineid AS REAL) asc

kusum

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2011-01-07 : 06:09:07
Only numeric data of what type?
REAL would be FLOAT but I think a LineId would be INT...


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -