Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What's wrong with this SPT containing dates
Message
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:
01134926
Message ID:
01134928
Views:
12
Check what ODBC error AERROR() returns. Most likely you will need quotes around dates. See corrections inline below

>
>Can anybody suggest what may be wrong in this SPT to MS-SQL. It just returns -1 for the SQLEXEC():
>
>StartDate = thisform.fromdate.value
>EndDate = thisform.todate.value
>
>TEXT TO cVar NOSHOW TEXTMERGE
>   SELECT CAST(RTRIM(charfield) AS char(10)) AS charfld,
      '<<m.StartDate>>' AS StartDate, '<<m.EndDate>>' as EndDate
>   FROM myTable
>   LEFT JOIN ...
>   WHERE ...
      AND fld_EntryDate >= '<<m.StartDate>>'
      AND fld_EntryDate <= '<<m.EndDate>>'
>   ORDER BY ...
>ENDTEXT
>
>SQLEXEC(nHndl, cVar, "curname")
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform