1 of 1 people found this helpful
The reason is the code for sorting.
If you sort an IP address using either a "String" or "Decimal" sort, then 192.x.x.x will come before 27.x.x.x. (I am not sure which they use.)
So to solve a the very simple, yet incorrect for your needs, method was used...they added the leading zeros.
See, with a text sort 027.x.x.x comes before 192.x.x.x.
I would prefer the leading Zeros were gone and I actually sumbitted a bug on this but it so low priority it was not considered. Here is what I would have preferred.
1. First convert the IP Address to a full number without the "." character, such as a large decimal value
2. Do a number/decimal sort.
3. That doesn't change the Big O
But alas, it is what it is...
The CR I submitted was this. If you want it fixed, call in and ask to be added to this CR. Though, even if you add your name to the CR it doesn't mean it will be fixed.
Four digits? That CR is going to need some dust blown off of it Seriously, since this is for an external reporting tool, maybe your DBA can help you with a solution. I'm not sure if it could be reformatted with a view, but a trigger and a separate table would definitely do it, and you wouldn't have any reason to get into dangerous schema modifications.
Four digits? That CR is going to need some dust blown off of it
That is not actually the case. There is a new CR database and they will have four character for a while now.
I came across the same issue recently. To get around this you could set up a view for reporting with the following code. This code was created for a Service Desk installation, but the same code could be easily adapted for a view: