Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Closest matching records
Message
De
31/08/2005 11:17:53
 
 
À
31/08/2005 10:32:12
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
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:
01045520
Vues:
20
Cetin,

Yes, thanks. We can call it a typo :).

Maybe this is a more elegant solution:
lnNum = 1

SELECT TOP lnNum MIN(ABS(Mydate - ldSearch)), MyDate;
 FROM Dates;
 GROUP BY 2;
 ORDER BY 1
Then it’s easier to select how large a result set one would get.


>Jens,
>Correcting a little typo:
>
>SELECT MAX(MyDate) FROM Dates WHERE;
> MyDate <= m.ldSearch;
> UNION;
> SELECT MIN(MyDate) FROM Dates WHERE;
> MyDate >= m.ldSearch
>
Cetin
>
>>Tariq,
>>
>>Will this do?
>>
>>
CREATE CURSOR Dates (MyDate D)
>>INSERT INTO Dates (MyDate) VALUES (DATE(2005, 2, 25))
>>INSERT INTO Dates (MyDate) VALUES (DATE(2005, 4, 12))
>>INSERT INTO Dates (MyDate) VALUES (DATE(2005, 5, 22))
>>INSERT INTO Dates (MyDate) VALUES (DATE(2005, 5, 28))
>>INSERT INTO Dates (MyDate) VALUES (DATE(2005, 6, 5))
>>INSERT INTO Dates (MyDate) VALUES (DATE(2005, 8, 31))
>>
>>ldSearch = DATE(2005, 5, 25)
>>
>>SELECT MAX(MyDate) FROM Dates WHERE;
>> MyDate <= ldSearch;
>> UNION;
>> SELECT MIN(MyDate) FROM Dates WHERE;
>> MyDate > ldSearch
>>
>>
>>>Dear Professors
>>>
>>>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
>>>
>>>Please help
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform