Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Closest matching records
Message
De
31/08/2005 05:16:06
 
 
À
30/08/2005 23:41:57
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 6 SP3
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Divers
Thread ID:
01045374
Message ID:
01045423
Vues:
20
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform