Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Query error using DTOC()
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00609459
Message ID:
00609463
Views:
14
>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')
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform