On 04/22/08 5:37 PM, "Don Wieland" <[EMAIL PROTECTED]> wrote in whole
or in part:
> On Apr 22, 2008, at 2:02 PM, Beverly Voth wrote:
>
>>> We are in the middle of our annual science fair at school and we
>>> have run up
>>> against a sorting problem. When I go to run ribbon labels that
>>> have the
>>> student's name and table number, the sort will not sort all of the
>>> table
>>> numbers correctly. The number are like a1, a2...a10, a11, a12. The
>>> sort will
>>> sort all the table number correct by letter, but the following
>>> numbers are not
>>> sorted numerically. Is a way to sort the numbers so the numbers
>>> following the
>>> letter are in numerical order.
>>> Thanks,Bill Wallace
>>
>>
>> Yes, you need TWO fields, one alphabetic, one numeric. Make both sort.
>
> Just for fun. Define one field:
>
> SerialSort - (Calculation, Number Result) =
>
> Let([
>
> a=theSerialAlphaField;
> b=Position("abcdefghijklmnopqrstuvwxyz"; Left(a;1); 1; 1);
> c=GetAsNumber("1" & Right("00" & b; 2) & Right("000000000" & Middle
> (a; 2; 20); 9))
> ];
> c)
>
> This calculation assumes that the first character will always be a
> single alpha character and the remaining of the serial number will be
> digits not equaling or exceed 1000,000,000.
>
> Hope this helps!!!
Ah, yep! I just wanted to make sure that everyone knows that "numbers"
inside of "text" do NOT sort numerically. Ergo the two fields, or
"padding-with-zeros" trick that Don so graciously described.
Assumption is that the "alpha" will always be ONE character and the "number"
will always be less than "1000,000,000". Ergo the two fields, in my
approach. Keep 'em separate and don't worry about it, sort by both, of
course. :D
--
Beverly Voth Tier3 Data & Web Services Group, LLC
606-864-0041 http://www.tier3web.com/xml.htm
Web Design & Hosting * Apple: ACN & ADC
Certified FileMaker 7 & 9 Developer * FileMaker Business Alliance
Coldfusion, Witango, PHP, MS SQL, MySQL, FMP, XML/XSLT, CSS
Over 14 years experience integrating databases and the internet!