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.
Author |
Topic |
stumbling
Posting Yak Master
104 Posts |
Posted - 2008-09-09 : 05:55:06
|
Hi ALLI have a column that is full of IP addresses that i need to sort from highest to lowest the problem is sort can not get them in to the correct order as per below any one have any ideas on this?Cheers192.168.32.147192.168.32.147192.168.32.148192.168.32.149192.168.32.15192.168.32.150192.168.32.151192.168.32.152192.168.32.153192.168.32.154192.168.32.156192.168.32.157192.168.32.158192.168.32.159192.168.32.16192.168.32.16192.168.32.160 |
|
sunil
Constraint Violating Yak Guru
282 Posts |
|
stumbling
Posting Yak Master
104 Posts |
Posted - 2008-09-09 : 06:15:31
|
Thanks for that i found this which works for me :- ))SELECT [IPAddress] FROM [WorkStation]ORDER BY CAST(PARSENAME([IPAddress], 4) AS INT), CAST(PARSENAME([IPAddress], 3) AS INT), CAST(PARSENAME([IPAddress], 2) AS INT), CAST(PARSENAME([IPAddress], 1) AS INT) |
|
|
|
|
|