Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What's wrong with this statement in SQLEXEC( ) ?
Message
 
 
To
23/09/2005 16:55:49
Peter Wagner
Point Informática Ltda.
Limeira, Brazil
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
Database:
MS SQL Server
Miscellaneous
Thread ID:
01052565
Message ID:
01052573
Views:
8
Peter,

The SQL Server can accept date constand either as string or as numeric value. You first select is equivalent to
csql = "select * from prestacoes where data_venc >= 9"
* which is the same as 
csql = "select * from prestacoes where data_venc >= '1900-01-10'
You would want to pass dates as string literals
csql = "select * from prestacoes where data_venc >= '2005/09/23'"
csql = "select * from prestacoes where data_venc <= '2006/02/28'"
>Hi, it's friday and I'm going crazy with a simple SQL statement.
>
>csql = "select * from prestacoes where data_venc >= 2005/09/23"
>a = SQLEXEC(nID,csql,"resultado")
>
>returns the data from SQL server as expected
>But, if I run this one:
>
>csql = "select * from prestacoes where data_venc <= 2006/02/28"
>a = SQLEXEC(nID,csql,"resultado")
>
>
>Returns no record
>
>But if I run those same statements in QA, I get the data as expected in both cases.
>Why when I use "< " ou "< =" I dont get those values that exist in table prestacoes.
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform