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:Regards
Hi allRegards
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.
Karl
Hi allRegards
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.
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()
Hello KarlOn Fri, 8 Jan 2021 07:54:33 -0800 (PST), Grzegorz R. wrote:
Hi allRegards
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.
KarlRegards
Karl
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 285 |
Nodes: | 16 (2 / 14) |
Uptime: | 68:01:15 |
Calls: | 6,488 |
Calls today: | 1 |
Files: | 12,096 |
Messages: | 5,275,268 |