• Mixed sroting order

    From Grzegorz R.@21:1/5 to All on Fri Jan 8 07:54:33 2021
    Hi all
    assume You have a database with fields NAME, DATE.
    Is it at all possible to sort the database that one field (NAME) is ascending and other field (DATE) is descending? Like this:
    A 9
    A 8
    A 6
    B 7
    B 3
    B 1
    C 5
    C 1
    Note that NAME may me long and have many different characters
    ?
    Simple order I use is NAME+DTOS(DATE) but then DATE is same direction (A/D) as NAME.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Karl Faller@21:1/5 to All on Fri Jan 8 20:39:49 2021
    On Fri, 08 Jan 2021 20:37:33 +0100, Karl Faller wrote:
    Just found in help:
    "This example illustrates how to create a descending order using more
    than one data type. Here, the key is created using the concatenation
    of date and character fields after the appropriate type conversion has
    taken place. This example uses Str() instead of DToS() since
    Descend() of a date returns a numeric value:
    USE sales NEW
    INDEX ON Str(Descend(SaleDate)) + salesman TO lastsale
    ==
    So, it should be name + Str(descend(Date))


    NAME + Descend(Dtos(Date))
    Beware, seem to remember there was a problem with Descend()


    On Fri, 8 Jan 2021 07:54:33 -0800 (PST), Grzegorz R. wrote:

    Hi all
    assume You have a database with fields NAME, DATE.
    Is it at all possible to sort the database that one field (NAME) is ascending and other field (DATE) is descending? Like this:
    A 9
    A 8
    A 6
    B 7
    B 3
    B 1
    C 5
    C 1
    Note that NAME may me long and have many different characters
    ?
    Simple order I use is NAME+DTOS(DATE) but then DATE is same direction (A/D) as NAME.
    Regards

    Karl
    Regards

    Karl

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Karl Faller@21:1/5 to Grzegorz R. on Fri Jan 8 20:37:33 2021
    NAME + Descend(Dtos(Date))
    Beware, seem to remember there was a problem with Descend()


    On Fri, 8 Jan 2021 07:54:33 -0800 (PST), Grzegorz R. wrote:

    Hi all
    assume You have a database with fields NAME, DATE.
    Is it at all possible to sort the database that one field (NAME) is ascending and other field (DATE) is descending? Like this:
    A 9
    A 8
    A 6
    B 7
    B 3
    B 1
    C 5
    C 1
    Note that NAME may me long and have many different characters
    ?
    Simple order I use is NAME+DTOS(DATE) but then DATE is same direction (A/D) as NAME.
    Regards

    Karl

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Grzegorz R.@21:1/5 to All on Sat Jan 9 02:37:58 2021
    piątek, 8 stycznia 2021 o 20:39:50 UTC+1 Karl Faller napisał(a):
    On Fri, 08 Jan 2021 20:37:33 +0100, Karl Faller wrote:
    Just found in help:
    "This example illustrates how to create a descending order using more
    than one data type. Here, the key is created using the concatenation
    of date and character fields after the appropriate type conversion has
    taken place. This example uses Str() instead of DToS() since
    Descend() of a date returns a numeric value:
    USE sales NEW
    INDEX ON Str(Descend(SaleDate)) + salesman TO lastsale
    ==
    So, it should be name + Str(descend(Date))
    NAME + Descend(Dtos(Date))
    Beware, seem to remember there was a problem with Descend()


    On Fri, 8 Jan 2021 07:54:33 -0800 (PST), Grzegorz R. wrote:

    Hi all
    assume You have a database with fields NAME, DATE.
    Is it at all possible to sort the database that one field (NAME) is ascending and other field (DATE) is descending? Like this:
    A 9
    A 8
    A 6
    B 7
    B 3
    B 1
    C 5
    C 1
    Note that NAME may me long and have many different characters
    ?
    Simple order I use is NAME+DTOS(DATE) but then DATE is same direction (A/D) as NAME.
    Regards

    Karl
    Regards

    Karl
    Hello Karl
    Thank You - I don't know how I missed DESCEND() function. Works perfectly well :)
    Again - thank You.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)