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
  #21  
Old   
east99
 
Posts: n/a

Default Re: Sorting ip address for dynamic table - 10-16-2007 , 04:22 PM






Cool, how?


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

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

He is using MS Access. PARSENAME() is t-sql. You will need to use
different
method to parse the ip.




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

Default Re: Sorting ip address for dynamic table - 10-16-2007 , 04:24 PM






^^^ i found that the other day, and quickly found that it didn't work.

thanks for the help guys.

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

Default Re: Sorting ip address for dynamic table - 10-16-2007 , 04:31 PM



What is the error that you get from using above code?

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

Default Re: Sorting ip address for dynamic table - 10-16-2007 , 04:34 PM



this is the error I get when testing the code:

[microsoft][obdc MS access driver] Syntax error (missing operator) in query expression 'CAST(PARSENAME(radio_ip, 4) ASINT)'

thanks, mark

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

Default Re: Sorting ip address for dynamic table - 10-16-2007 , 04:35 PM



[microsoft][obdc MS access driver] Syntax error (missing operator) in query expression 'CAST(PARSENAME(radio_ip, 4) ASINT)'

that's the error I get

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

Default Re: Sorting ip address for dynamic table - 10-16-2007 , 04:41 PM



http://www.aspfaq.com/downloads/ASPFAQ-2006-04-18.pdf

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

Default Re: Sorting ip address for dynamic table - 10-16-2007 , 04:42 PM



http://www.aspfaq.com/downloads/ASPFAQ-2006-04-18.pdf

Reply With Quote
  #28  
Old   
Michael Fesser
 
Posts: n/a

Default Re: Sorting ip address for dynamic table - 10-16-2007 , 04:59 PM



..oO(relecom)

Quote:
this is the error I get when testing the code:

[microsoft][obdc MS access driver] Syntax error (missing operator) in
query expression 'CAST(PARSENAME(radio_ip, 4) ASINT)'
Where's the 'ASINT' coming from? Shouldn't that be 'AS INT' instead?

Micha


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

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



yes it is AS INT, I had to retype the error, it was my typo.

Mark

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

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



-- Access:
SELECT CINT(column)
-- SQL Server:
SELECT CAST(column AS INT)

Try this:
SELECT [radio_ip] FROM [sc_survey]
ORDER BY CINT(PARSENAME([radio_ip], 4) AS INT),
CINT(PARSENAME([radio_ip], 3) AS INT),
CINT(PARSENAME([radio_ip], 2) AS INT),
CINT(PARSENAME([radio_ip], 1) AS INT)

Not sure, never tried to sort Ip addresses but am intereste in helping you
solve this.


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.