Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Query error using DTOC()
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00609459
Message ID:
00609463
Vues:
13
>SELECT * FROM schedule WHERE DTOC(beg_date) > '01/01/2001'.
>This is giving me all the records from the table (25226)
>
>SELECT * FROM schedule WHERE YEAR(beg_date) > 2001
>This is giving me the correct number of records (2080)
>
>Both are valid queries. Correct ?
>What did I do to make the DTOC query not work anymore ?
>Am I going crazy ?
>
>Thanks, Ken


because you are doing a character comparison
eg
? '02/01/1900' > '01/01/2001'
= .T.
Try comparing as dates using CTOD() instead
SELECT * FROM schedule WHERE beg_date > CTOD('01/01/2001')
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform