• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 259
  • Last Modified:

Sort by IP

I am currently building an inventory database in FileMaker 8 Pro and need to be able to sort devices by IP address.

Thanks in advance!
0
MCPJ
Asked:
MCPJ
  • 2
1 Solution
 
lesouefCommented:
2 ways:
either you reformat the IP entered by the user to have it use 3 digits/member (ex: 192.168.001.001) and then sort correctly.
how? get the user to enter the ip with a question, put it in a global field, then reformat it before entering it in the IP field
or
you create a calculated field to work out the right IP format from the IP field entered by the user and use it to sort.
0
 
lesouefCommented:
and the formula is for the reformatted ip address is:
("ip" the entered address)

Right("000" & Middle ( ip ; 1 ; Position (  ip; "." ; 1 ; 1 ) -1);3)
 & "." &
Right("000" & Middle ( ip ; Position ( ip ; "." ; 1 ; 1 ) +1 ; Position ( ip ; "." ; 1 ; 2 ) - Position ( ip ; "." ; 1 ; 1 ) -1);3)
& "." &
Right("000" & Middle ( ip ; Position ( ip ; "." ; 1 ; 2 ) +1 ; Position ( ip ; "." ; 1 ; 3 ) - Position ( ip ; "." ; 1 ; 2 ) -1);3)
& "." &
Right("000" & Middle ( ip ; Position ( ip ; "." ; 1 ; 3 ) +1 ; Length ( ip ) - Position ( ip ; "." ; 1 ; 2 ) -1);3)
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now