Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need to extract data from sql server db
Message
 
To
25/09/2002 17:05:21
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00704486
Message ID:
00704494
Views:
18
Hi,

you have to use either ODBC Escape syntax or T-SQL. VFP functions don't work with SQL-Server. Have a look at the DATEPART() function of SQL Server and you will find what you need.

Additionally, you may not include "INTO TABLE TEMPTABLE". Results from SQLEXEC() are always stored in a cursor.

Regards,
Armin

>I need to extract some data e.g. phone nos based on date from sql db. I have inserted records in past in sql from vfp using
>
>sSql = "Insert into Abc (phone, clistcode ) "
>sSql = sSql + " values ('" + phone + "','" + listcode "')"
>z = SqlExec(nhandle,sSql,'')
>
>but I am not able to extract data from sql using query e.g.
>
>sSql = "select * from abc where YEAR(calltime)=2002 AND MONTH(CALLTIME)=10 AND day(calltime)=20 INTO TABLE TEMPTABLE"
>
>TIA
>
>Munish Arora

Armin Neudert
Regional Director (Stuttgart) of German FoxPro User Group dFPUG

MCP for Visual FoxPro

Expert/Editor of the VFP section in the German Codezone community portal
Previous
Reply
Map
View

Click here to load this message in the networking platform