none
Sharepoint 2007 list troubles: IP fields and sort by IP

    Question

  • Help! I've created text fields that have IP's but they do not get sorted right.

    E.g.
    172.20.5.10
    172.20.5.101
    172.20.5.102
    172.20.5.11

    I know this is correct sort for normal text. Do anybody have any clue of how I can use IP's in Sharepoint 2007 lists?

    Wednesday, October 20, 2010 10:57 AM

Answers

  • Hi HAL,

    Do you want to sort IP like this:

    172.20.5.10
    172.20.5.11
    172.20.5.10
    1
    172.20.5.1
    02

    If so please test follow these steps:

    1 Create a new column in the list and select Calculated(calculation based on other columns) type.

    2 And =RIGHT(IP,3) in the Formula section.(Here IP is the Column name of your ip column)

    3 Select Single line of text or Number(1,1.0,100) in the data type returned from this formular is: checkbox.

    4 Click OK.

    5 Go back to the list setting > Click All Item view > uncheck the Display checkbox of the new column in the Columns part > sort by the new column.

    6 Click OK.

    Now it would sort as above.

    Here is a Formulas reference maybe could help.

    http://office.microsoft.com/en-us/windows-sharepoint-services-help/examples-of-common-formulas-HA001160947.aspx


    Best regards.
    Friday, October 22, 2010 12:25 PM
  • Hi HAL,

    I think we can combine this two calculate column to one calculate column.

    Please create a calculate column with this Formula:

    =LEFT(IP-address,7)&RIGHT(IP-address,3)

    Then sort by this calculate column.


    Best regards.
    Wednesday, October 27, 2010 11:46 AM

All replies

  • I got one post where auther created custom filed for IP address filed, also this support sorting too.

    Please go through this Custom field for IP


    Regards, Sandip Patil, .Net,Sharepoint Developer www.worldofsharepoint.com
    Wednesday, October 20, 2010 11:17 AM
  • Hi HAL,

    Do you want to sort IP like this:

    172.20.5.10
    172.20.5.11
    172.20.5.10
    1
    172.20.5.1
    02

    If so please test follow these steps:

    1 Create a new column in the list and select Calculated(calculation based on other columns) type.

    2 And =RIGHT(IP,3) in the Formula section.(Here IP is the Column name of your ip column)

    3 Select Single line of text or Number(1,1.0,100) in the data type returned from this formular is: checkbox.

    4 Click OK.

    5 Go back to the list setting > Click All Item view > uncheck the Display checkbox of the new column in the Columns part > sort by the new column.

    6 Click OK.

    Now it would sort as above.

    Here is a Formulas reference maybe could help.

    http://office.microsoft.com/en-us/windows-sharepoint-services-help/examples-of-common-formulas-HA001160947.aspx


    Best regards.
    Friday, October 22, 2010 12:25 PM
  • Liu, i get the following error in my sharepoint 2007 when pressing OK in step 6:
    Formelen inneholder en syntaksfeil, eller støttes ikke.   at Microsoft.SharePoint.Library.SPRequestInternalClass.AddField(String bstrUrl, String bstrListName, String bstrSchemaXml, Int32 grfAdd)
       at Microsoft.SharePoint.Library.SPRequest.AddField(String bstrUrl, String bstrListName, String bstrSchemaXml, Int32 grfAdd)

     

    Monday, October 25, 2010 1:34 PM
  • Hi HAL,

    Please check the calculate column whether it got correct text(step 4).

    I think you are using Norwegian rather than English. If you are using a different language page layout you may need to use their punctuations.  I wonder if Norwegian use something else instead of “,”?


    Best regards.
    Tuesday, October 26, 2010 6:12 AM
  • Thanks!

    I tried

    =RIGHT(IP-adresse,3)   failed
    =HØYRE(IP-adresse,3) failed
    =HØYRE(IP-adresse;3)  failed

    =HØYRE([IP-adresse];3)  finally worked! :)

     

    Well after checking out this, it did not work as expected as it did only sort at last four digits, and I had some 192.168 addresses as a separate serie there. thus I guess I need a custom field. I will look into that.


    Tuesday, October 26, 2010 7:50 AM
  • Hi,

    Thanks for your reply.

    I think you could create another calculate column and use Left(IP-address,7) Formula.

    Then sort by this calculate column(Show items in descending order) first and then sort by the previous calculate column.

    Hope it would help.


    Best regards.
    Tuesday, October 26, 2010 8:15 AM
  • I do my sort first by Branch Office name, then by IP.


    Sharepoint only supports 2 sorts, so I cannot add one more.

    Wednesday, October 27, 2010 11:12 AM
  • Hi HAL,

    I think we can combine this two calculate column to one calculate column.

    Please create a calculate column with this Formula:

    =LEFT(IP-address,7)&RIGHT(IP-address,3)

    Then sort by this calculate column.


    Best regards.
    Wednesday, October 27, 2010 11:46 AM