List:General Discussion« Previous MessageNext Message »
From:Peter Teunissen Date:November 24 2007 10:28am
Subject:Re: Unusual sort
View as plain text  
On 24-nov-2007, at 0:29, Jim wrote:

> I have a table containing web site host names, most of them having  
> both a "name.com" and "www.name.com" version, that I'd like sorted  
> in the following manner:
>
> axxx.com
> www.axxx.com
> bxxx.com
> www.bxxx.com
> wxxx.com
> www.wxxx.com
> zxxx.com
> www.zxxx.com
>
> Any way to do this?
>
Sure, just create a extra sort column, and fill it with the original  
names after you stripped of the parts before the second dot, counting  
from the right. I'd first count the number of dots to decide wich  
fields have to be altered. Then, based on the number of dots,  
calculate the position of the one but last dot and do a substring on  
the field. Then sort based on that new column.

HTH

Peter
Thread
Unusual sortJim24 Nov
  • Re: Unusual sortPeter Teunissen24 Nov
  • RE: Unusual sortMartin Gainty24 Nov
    • RE: Unusual sortEric Frazier25 Nov