Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread FindNearest using a Descending Key
Tue, May 30 2006 4:09 AMPermanent Link

Francois Steyn
Hi.

Im using Delphi 7 with DBISAM4.24 Build 1 in a mixed environment using Local&Remote
sessions.  Im trying to use a Table.FindNearest on a Descending Key.  My result is that
the active record is always 1 after the actual record that it should be.

Consider the following list of items in descending order(Primary Key = Ascending,
Secondary Key = Descending):
1: 662001
2: 661001
3: 660001
4: 110001

If I FindNearest(['66']) I land up on 4;
If I FindNearest(['661']) I land up on 3;

Would it be possible for FindNearest to work the same way as a Ascending order and land on
1 if i FindNearest(['66'])? Like search from the top?

Thanks Smile
Francois Steyn
Tue, May 30 2006 9:09 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Francois,

<< Would it be possible for FindNearest to work the same way as a Ascending
order and land on 1 if i FindNearest(['66'])? Like search from the top? >>

It would be possible, but it wouldn't be correct.  If you want an ascending
FindNearest result, then you'll have to add another index that uses
ascending columns for the secondary key.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image