HighDots Forums  

Sorting ip address for dynamic table

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Sorting ip address for dynamic table in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #41  
Old   
bregent
 
Posts: n/a

Default Re: Sorting ip address for dynamic table - 10-16-2007 , 05:55 PM






Quote:
I am at work, adn that was a 1200+ page document
You are confusing my posts with someone else's. My link is a simple
explanation of sorting ip's in Access. I'll make it easy for you - here's the
sql:

SELECT radio_ip.IP
FROM radio_ip
ORDER BY Val(Left([IP],(InStr(1,[IP],".")-1))),
Val(Mid([IP],InStr(1,[IP],".")+1,InStr(InStr(1,[IP],".")+1,[IP],".")-InStr(1,[IP
],".")-1)),
Val(Mid([IP],InStr(InStr(1,[IP],".")+1,[IP],".")+1,InStr(InStr(InStr(1,[IP],".")
+1,[IP],".")+1,[IP],".")-InStr(InStr(1,[IP],".")+1,[IP],".")-1)),
Val(Right([IP],Len([IP])-InStr(InStr(InStr(1,[IP],".")+1,[IP],".")+1,[IP],".")))
;




Reply With Quote
  #42  
Old   
east99
 
Posts: n/a

Default Re: Sorting ip address for dynamic table - 10-16-2007 , 05:55 PM







You could try this:

http://www.sqlmag.com/Article/ArticleID/7846/sql_server_7846.html



Reply With Quote
  #43  
Old   
east99
 
Posts: n/a

Default Re: Sorting ip address for dynamic table - 10-16-2007 , 05:58 PM



What is the column type?


[q]Originally posted by: relecom
nothing special, for this talble, there is some location information, and a
cloumn with ip addresses. (among other coloumns) nothing fancy
thanks, mark


[Q]Originally posted by: east99
Could I ask to see the structure of the table for the database in question?[/Q]

[/q]




Reply With Quote
  #44  
Old   
relecom
 
Posts: n/a

Default Re: Sorting ip address for dynamic table - 10-17-2007 , 11:58 AM



number

Mark


[q]Originally posted by: east99
What is the column type?


[Q]Originally posted by: relecom
nothing special, for this talble, there is some location information, and a
cloumn with ip addresses. (among other coloumns) nothing fancy
thanks, mark


[Q]Originally posted by: east99
Could I ask to see the structure of the table for the database in question?[/Q]

[/Q]

[/q]




Reply With Quote
  #45  
Old   
relecom
 
Posts: n/a

Default Re: Sorting ip address for dynamic table - 10-17-2007 , 12:24 PM



this is what I get as an error when I use the above code.

[microsoft][ODBC Access Driver] " is not a valid name. Make sure that it does
not include invalid characters or punctuation and that it's not too long.


Mark


[q]Originally posted by: bregent
Quote:
I am at work, adn that was a 1200+ page document
You are confusing my posts with someone else's. My link is a simple
explanation of sorting ip's in Access. I'll make it easy for you - here's the
sql:

SELECT radio_ip.IP
FROM radio_ip
ORDER BY Val(Left([IP],(InStr(1,[IP],".")-1))),
Val(Mid([IP],InStr(1,[IP],".")+1,InStr(InStr(1,[IP],".")+1,[IP],".")-InStr(1,[IP
],".")-1)),
Val(Mid([IP],InStr(InStr(1,[IP],".")+1,[IP],".")+1,InStr(InStr(InStr(1,[IP],".")
+1,[IP],".")+1,[IP],".")-InStr(InStr(1,[IP],".")+1,[IP],".")-1)),
Val(Right([IP],Len([IP])-InStr(InStr(InStr(1,[IP],".")+1,[IP],".")+1,[IP],".")))
;
[/q]





Reply With Quote
  #46  
Old   
bregent
 
Posts: n/a

Default Re: Sorting ip address for dynamic table - 10-17-2007 , 12:44 PM



Quote:
this is what I get as an error when I use the above code.

[microsoft][ODBC Access Driver] " is not a valid name. Make sure that it does
not include invalid characters or punctuation >and that it's not too long.

Did you rename the table and column name in that code to match your database
details?




Reply With Quote
  #47  
Old   
relecom
 
Posts: n/a

Default Re: Sorting ip address for dynamic table - 10-17-2007 , 12:51 PM



yes I did.

thanks, mark

Reply With Quote
  #48  
Old   
bregent
 
Posts: n/a

Default Re: Sorting ip address for dynamic table - 10-17-2007 , 12:56 PM



Quote:
yes I did.
What you might want to try is creating a query in Access using that code and
check if that works. If it doesn't run, you should get a better error message
that will help troubleshoot. If it does work, then you might want to just call
the Access query from ASP/VB rather than having all of the complex syntax in
your VB script.



Reply With Quote
  #49  
Old   
relecom
 
Posts: n/a

Default Re: Sorting ip address for dynamic table - 10-17-2007 , 01:18 PM



can I make this work with a stored procedure in dreamweaver? that might make things easier, then just call the stored procedure when listing the ip addresses.

thanks, Mark

Reply With Quote
  #50  
Old   
east99
 
Posts: n/a

Default Re: Sorting ip address for dynamic table - 10-17-2007 , 02:13 PM



relecom,
This question you have is pretty complicated by the amount of posts needed
to get an answer.
Could I ask what is so important to sort on an IP Address?

Cheers



"relecom" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
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




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.