Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Closest matching records
Message
From
31/08/2005 05:16:06
 
 
To
30/08/2005 23:41:57
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 6 SP3
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01045374
Message ID:
01045423
Views:
22
Do you mean the two closest dates or the two dates that bracket the selected date. I.e. should {06/06/2005} return {26/05/2005},{05/06/2005} or {05/06/2005},{31/08/2005}.

IAC, in VFP there's no easy way to get the *nearest* date. You can use Ryan's suggestion to get the *next higher* date and work from there. You could also use:
=SEEK()
IF FOUND
  ? RECNO()
ELSE
  ? RECNO(0)
ENDIF
which avoids messing with 'SET NEAR' and will get an exact match if available, next higher if not (assuming there is an higher otherwise 0).
HTH,
Viv

>Field1 entitled date1, of table1, has following date type data
>
>{25/02/2005}
>{12/04/2005}
>{22/05/2005}
>{28/05/2005}
>{05/06/2005}
>{31/08/2005}
>
>In text1 I enter date {25/05/2005}, This date is not in table.
>Is it possible to findout TWO closet matching dates i.e
>
>{22/05/2005} && closest smaller date
>{28/05/2005} && closest bigger date
Previous
Reply
Map
View

Click here to load this message in the networking platform