Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
INDEX ON DateTime Field?
Message
De
27/10/1998 09:43:33
 
 
À
27/10/1998 09:36:02
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00150884
Message ID:
00150921
Vues:
19
Tom ---

Part 2 to my post:

If you change the select to the following it works:

SELECT * FROM c_tbl WHERE TTOC(dt_tm) = "10/27/1998 08:30:00 AM"





>
>I couldn't get the code to work under VFP5.0 and retain a DateTime index. However, the following code worked in VFP6. The problem has to be some sort of datatime ambiguity:
>
>CREATE CURSOR c_tbl (dt_tm T)
>INSERT INTO c_tbl (dt_tm) VALUES ({^1998/10/27 08:30:00 A})
>INSERT INTO c_tbl (dt_tm) VALUES ({^1998/10/27 08:31:00 A})
>INDEX ON dt_tm TAG dt_tm
>SELECT * FROM c_tbl WHERE dt_tm = {^1998/10/27 08:30:00 A}
>
>
>>I am having trouble get the proper return results
>>when using an index tag on a datetime field. Try
>>this and you will see what I mean
>>
>>CREATE CURSOR c_tbl (dt_tm T)
>>INSERT INTO c_tbl (dt_tm) VALUES ({10/27/1998 08:30:00 AM})
>>INSERT INTO c_tbl (dt_tm) VALUES ({10/27/1998 08:31:00 AM})
>>INDEX ON dt_tm TAG dt_tm
>>SELECT * FROM c_tbl WHERE dt_tm = {10/27/1998 08:30:00 AM}
>>
>>?_TALLY && returns nothing
>>
>>SELECT c_tbl
>>DELETE TAG dt_tm
>>SELECT * FROM c_tbl WHERE dt_tm = {10/27/1998 08:30:00 AM}
>>?_tally && returns 1
>>
>>Why am I getting inconsistent results?
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform