![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
#12
| |||
| |||
|
#13
| |||
| |||
|
#14
| |||
| |||
|
#15
| |||
| |||
|
#16
| |||
| |||
|
#17
| |||
| |||
|
#18
| |||
| |||
|
|
[q]Originally posted by: Newsgroup User .oO(relecom) anyone else? I can't cdhange how the ip's are stored in the database, I only have control over the ASP side. You could still do it in SQL and perform the IP <-> INT conversion when fetching the results ... Micha [/q] can you elaborate on that? |
|
I was told to use this code: ORDER BY CAST(PARSENAME(Radio_ip, 4) AS INT), CAST(PARSENAME(Radio_ip, 3) AS INT), CAST(PARSENAME(Radio_ip, 2) AS INT), CAST(PARSENAME(Radio_ip, 1) AS INT) |
|
but it yields an error. |
#19
| |||
| |||
|
|
I am trying to sort an ip address coloumn, and it't working but not sorting properly. SQL: SELECT radio_ip FROM sc_survey WHERE radio_ip LIKE MMColParam% ORDER BY radio_ip ASC as you cvan see it's sorting, but not in order what is the proper format to sort ip addresses in actual order? thanks, Mark |
#20
| |||
| |||
|
|
Try this: SELECT [radio_ip] FROM [sc_survey] ORDER BY CAST(PARSENAME([radio_ip], 4) AS INT), CAST(PARSENAME([radio_ip], 3) AS INT), CAST(PARSENAME([radio_ip], 2) AS INT), CAST(PARSENAME([radio_ip], 1) AS INT) |
![]() |
| Thread Tools | |
| Display Modes | |
| |