Newbies Jacob White Posted December 20, 2005 Newbies Posted December 20, 2005 I've got a database to keep track of IP addresses and I need to sort them by IP. The problem thai I'm having is that I've got more IPs than I can fit into a value list.
Ender Posted December 21, 2005 Posted December 21, 2005 Welcome Jacob, The trouble with IP addresses is that a full address is not a number and it's not really appropriate to sort it alphabetically. This makes them difficult to sort either as a regular field or in a value list. If the IPs are all in the same subnet, then it may be easier to just sort by the last part. If not, it may be necessary to break the IPs into pieces and sort by each piece. If you can say more about what this is needed for, perhaps someone can offer a good solution or a workaround.
comment Posted December 21, 2005 Posted December 21, 2005 I am not quite sure how a value list is relevant here. To sort by IP address, I believe it would be best to convert the IP to a decimal number first, then sort by the calculated field (result is number) = Let ( [ text = Substitute ( IP ; "." ; " " ) ; W = LeftWords ( text ; 1 ) ; R = MiddleWords ( text ; 2 ; 1 ) ; G = MiddleWords ( text ; 3 ; 1 ) ; B = RightWords ( text ; 1 ) ] ; B + G * 256 + R * 256^2 + W * 256^3 )
Recommended Posts
This topic is 6912 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now