Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Locate Nearest Data
Message
From
17/04/2008 02:19:15
 
 
To
16/04/2008 23:57:48
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP1
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01311354
Message ID:
01311376
Views:
16
>What is your defenition of 'nearest' in this case?
>
>Dear Sir,
>
>I told it in my example.
>
>Suppose the data is as
>
>5
>6
>8
>9
>
>If text1 is equal to 7 then I want to get 6.
>I do not want 8

You can use Set Near with a Descending index expression.

hth
-Stefan
CREATE CURSOR temp (test Int)
INSERT INTO temp VALUES (5)
INSERT INTO temp VALUES (6)
INSERT INTO temp VALUES (8)
INDEX on test TAG testdesc DESCENDING
SET NEAR ON
? SEEK(7)
? temp.test
Previous
Reply
Map
View

Click here to load this message in the networking platform